Permalink
Browse files

MDL-26185: simplify the logic of email message output and removing em…

…ail address cache
  • Loading branch information...
1 parent dae6b38 commit 9d61d9ac6dd737cc67837b7bf516040e40dadfe4 @rwijaya rwijaya committed Apr 1, 2011
Showing with 1 addition and 11 deletions.
  1. +1 −11 message/output/email/message_output_email.php
@@ -46,18 +46,8 @@ function send_message($eventdata) {
return true;
}
- //hold onto email preference because /admin/cron.php sends a lot of messages at once
- static $useremailaddresses = array();
-
//check user preference for where user wants email sent
- if (!array_key_exists($eventdata->userto->id, $useremailaddresses)) {
- $useremailaddresses[$eventdata->userto->id] = get_user_preferences('message_processor_email_email', $eventdata->userto->email, $eventdata->userto->id);
- }
- $usertoemailaddress = $useremailaddresses[$eventdata->userto->id];
-
- if ( !empty($usertoemailaddress)) {
- $userto->email = $usertoemailaddress;
- }
+ $eventdata->userto->email = get_user_preferences('message_processor_email_email', $eventdata->userto->email, $eventdata->userto->id);
$result = email_to_user($eventdata->userto, $eventdata->userfrom,
$eventdata->subject, $eventdata->fullmessage, $eventdata->fullmessagehtml);

0 comments on commit 9d61d9a

Please sign in to comment.