You are here

function multiple_email_expire_address in Multiple E-mail Addresses 5

Same name and namespace in other branches
  1. 6 multiple_email.module \multiple_email_expire_address()
  2. 7 multiple_email.module \multiple_email_expire_address()
  3. 2.x multiple_email.module \multiple_email_expire_address()

Removes the specified address from the user who added it and sends their primary email account a message notifying them about the expiration.

Parameters

integer $eid:

1 call to multiple_email_expire_address()
multiple_email_cron in ./multiple_email.module
Implementation of hook_cron()

File

./multiple_email.module, line 524
multiple_email module file

Code

function multiple_email_expire_address($eid) {
  $email = multiple_email_get_address($eid);
  $account = user_load(array(
    'uid' => $email->uid,
  ));
  $subject = multiple_email_message_part('subject', 'expire', $account, $email);
  $body = multiple_email_message_part('body', 'expire', $account, $email);
  multiple_email_delete_email($eid);
  drupal_mail('multiple_email_expire', $account->mail, $subject, $body, variable_get('site_mail', ini_get('sendmail_from')));
  watchdog('Multiple Email', "{$email->email} ({$email->eid}) for {$account->name} ({$account->uid}) has expired and been removed");
}