Permalink
Browse files

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

…user preference causing error
  • Loading branch information...
Sam Hemelryk
Sam Hemelryk committed Apr 5, 2011
1 parent 773e3c5 commit bbb79f47a758a36b7228058357c86b07af2feadc
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 bbb79f4

Please sign in to comment.