function _ed_classified_send_user_notification_email in Classified Ads 6.2
Same name and namespace in other branches
- 5.2 ed_classified_notifications.inc \_ed_classified_send_user_notification_email()
- 5 ed_classified_notifications.inc \_ed_classified_send_user_notification_email()
- 7.2 ed_classified_notifications.inc \_ed_classified_send_user_notification_email()
Send an email notification to the specified user
2 calls to _ed_classified_send_user_notification_email()
- _ed_classified_notify_advertisers_periodic in ./
ed_classified_notifications.inc - Process "periodic" notifications.
- _ed_classified_notify_user_of_ad_expiration in ./
ed_classified_notifications.inc - Notify a user that their ad has expired.
File
- ./
ed_classified_notifications.inc, line 87 - user notifications for imple text-based classified ads module
Code
function _ed_classified_send_user_notification_email(&$user, $key = '') {
$parms = _ed_classified_displayname_parms();
$params['account'] = $user;
$params['context'] = array(
'!sitename' => variable_get('site_name', ''),
'!user_ads_url' => url('user/' . $user->uid . '/' . EDI_CLASSIFIED_PATH_NAME, array(
'absolute' => TRUE,
)),
'!siteurl' => url('', array(
'absolute' => TRUE,
)),
);
$params['context'] = array_merge($params['context'], $parms);
$from = variable_get('site_mail', ini_get('sendmail_from'));
// http://drupal.org/node/77689
$version = explode('.', DRUPAL_VERSION);
switch (reset($version)) {
case 5:
$message = array();
// Invoke hook_mail() manually.
ed_classified_mail($key, $message, $params);
return drupal_mail($key, $user->mail, $message['subject'], $message['body'], $from);
break;
case 6:
case 7:
return drupal_mail(EDI_CLASSIFIED_MODULE_NAME, $key, $user->mail, user_preferred_language($user), $params, $from);
break;
}
}