Permalink
Browse files

messaging MDL-26185 Last minute fix of bug during integration, empty …

…user preference causing error
  • Loading branch information...
1 parent 42a50a0 commit f0462212724b1394a120450404408460d4525ee5 Sam Hemelryk committed Apr 5, 2011
Showing with 4 additions and 1 deletion.
  1. +4 −1 message/output/email/message_output_email.php
@@ -47,7 +47,10 @@ function send_message($eventdata) {
}
//check user preference for where user wants email sent
- $eventdata->userto->email = get_user_preferences('message_processor_email_email', $eventdata->userto->email, $eventdata->userto->id);
+ $preferedemail = get_user_preferences('message_processor_email_email', null, $eventdata->userto->id);
+ if (!empty($preferedemail)) {
+ $eventdata->userto->email = $preferedemail;
+ }
$result = email_to_user($eventdata->userto, $eventdata->userfrom,
$eventdata->subject, $eventdata->fullmessage, $eventdata->fullmessagehtml);

0 comments on commit f046221

Please sign in to comment.