system_send_email_action

Versions
6 – 7
system_send_email_action($object, $context)

Implement a configurable Drupal action. Sends an email.

Code

modules/system/system.module, line 2838

<?php
function system_send_email_action($object, $context) {
  if (empty($context['node'])) {
    $context['node'] = $object;
  }

  $recipient = token_replace($context['recipient'], $context);

  $language = user_preferred_language($account);
  $params = array('context' => $context);

  if (drupal_mail('system', 'action_send_email', $recipient, $language, $params)) {
    watchdog('action', 'Sent email to %recipient', array('%recipient' => $recipient));
  }
  else {
    watchdog('error', 'Unable to send email to %recipient', array('%recipient' => $recipient));
  }
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.