Commit 9eff5d95 authored by webchick's avatar webchick
Browse files

#714190 by rfay: Fixed system_send_email_action() uses account without initializing it.

parent 2b298026
......@@ -2961,7 +2961,16 @@ function system_send_email_action($entity, $context) {
$recipient = token_replace($context['recipient'], $context);
$language = user_preferred_language($account);
// If the recipient is a registered user with a language preference, use
// the recipient's preferred language. Otherwise, use the system default
// language.
$recipient_account = user_load_by_mail($recipient);
if ($recipient_account) {
$language = user_preferred_language($recipient_account);
}
else {
$language = language_default();
}
$params = array('context' => $context);
if (drupal_mail('system', 'action_send_email', $recipient, $language, $params)) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment