You are here

function redhen_contact_rules_action_fetch_by_mail in RedHen CRM 7

Rules action: fetch contact by email address.

1 string reference to 'redhen_contact_rules_action_fetch_by_mail'
redhen_contact_rules_action_info in modules/redhen_contact/includes/redhen_contact.rules.inc
Implements hook_rules_action_info().

File

modules/redhen_contact/includes/redhen_contact.rules.inc, line 62
Rules integration for RedHen Contacts.

Code

function redhen_contact_rules_action_fetch_by_mail($mail) {
  $contacts = redhen_contact_load_by_mail($mail);
  $contact = $contacts ? array_shift($contacts) : NULL;
  return array(
    'fetched_contact' => $contact,
  );
}