You are here

function _subscriptions_mail_add_mailkey in Subscriptions 2.0.x

Same name and namespace in other branches
  1. 7 subscriptions_mail.cron.inc \_subscriptions_mail_add_mailkey()

Helper function to add the mailkey if enabled.

1 call to _subscriptions_mail_add_mailkey()
_subscriptions_mail_mail_alter in subscriptions_mail/subscriptions_mail.cron.inc
Implements hook_mail_alter().

File

subscriptions_mail/subscriptions_mail.cron.inc, line 394
Subscriptions module mail gateway (cron functions).

Code

function _subscriptions_mail_add_mailkey($body, $mailkey, $language = NULL) {
  if (variable_get('subscriptions_showmailkeys', 0)) {
    $prefix = substr($body, 0, 2);
    $prefix = $prefix[1] == ' ' ? $prefix : '';
    $body .= $prefix . $mailkey . (empty($language) ? '' : '/' . $language) . "\n";
  }
  return $body;
}