11<?php
22
3+ /**
4+ * @file
5+ * Email notifier plugin class.
6+ */
7+
38/**
49 * Email notifier.
510 */
611class MessageNotifierEmail extends MessageNotifierBase {
712
13+ /**
14+ * Implements MessageNotifierInterface::deliver().
15+ */
816 public function deliver (array $ output = array ()) {
917 $ plugin = $ this ->plugin ;
1018 $ message = $ this ->message ;
@@ -16,19 +24,23 @@ public function deliver(array $output = array()) {
1624
1725 $ languages = language_list ();
1826 if (!$ options ['language override ' ]) {
19- $ lang = !empty ($ account ->language ) && $ account ->language != LANGUAGE_NONE ? $ languages [$ account ->language ]: language_default ();
27+ $ lang = !empty ($ account ->language ) && $ account ->language != LANGUAGE_NONE ? $ languages [$ account ->language ] : language_default ();
2028 }
2129 else {
2230 $ lang = $ languages [$ message ->language ];
2331 }
24-
32+ // Start with basic clean-up to remove line-feeds etc.
33+ $ output ['message_notify_email_subject ' ] = trim ($ output ['message_notify_email_subject ' ]);
2534 // The subject in an email can't be with HTML, so strip it.
2635 $ output ['message_notify_email_subject ' ] = strip_tags ($ output ['message_notify_email_subject ' ]);
36+ // Decode entities.
37+ $ output ['message_notify_email_subject ' ] = decode_entities ($ output ['message_notify_email_subject ' ]);
2738
2839 // Pass the message entity along to hook_drupal_mail().
2940 $ output ['message_entity ' ] = $ message ;
3041
31- $ result = drupal_mail ('message_notify ' , $ message ->type , $ mail , $ lang , $ output );
42+ $ result = drupal_mail ('message_notify ' , $ message ->type , $ mail , $ lang , $ output );
43+
3244 return $ result ['result ' ];
3345 }
3446
0 commit comments