You are here

function constant_contact_confirmation_email in Constant Contact 6

Same name and namespace in other branches
  1. 5 constant_contact.module \constant_contact_confirmation_email()

Send a confirmation email

Parameters

string $address email to send to:

string $list_name friedly name of list that is being subscribed to:

Return value

boolean success status

1 call to constant_contact_confirmation_email()
constant_contact_block_form_submit in ./constant_contact.module
Implementation of hook_form_submit() process the join mailing list block

File

./constant_contact.module, line 508

Code

function constant_contact_confirmation_email($address, $list_name) {
  global $user, $base_url;
  $variables = array(
    '!list_name' => $list_name,
    '!username' => $user->name,
    '!site' => variable_get('site_name', 'Drupal'),
    '!login_url' => user_pass_reset_url($account),
    '!uri' => $base_url,
    '!uri_brief' => substr($base_url, strlen('http://')),
    '!mailto' => $address,
    '!date' => format_date(time()),
    '!login_uri' => url('user', NULL, NULL, TRUE),
    // version 6 is url('user', array('absolute' => TRUE)),
    '!uri_list_unsubscribe' => url('constant_contact/unsubscribe/' . urlencode($list_name), NULL, NULL, TRUE),
  );
  return drupal_mail('constant_contact-confirmation', $address, t(variable_get('constant_contact_email_subject', ''), $variables), t(variable_get('constant_contact_email_body', ''), $variables), variable_get('site_mail', ini_get('sendmail_from')));
}