mirror of
https://github.com/moodle/moodle.git
synced 2025-04-13 04:22:07 +02:00
Merge branch 'MDL-68465-master' of git://github.com/junpataleta/moodle
This commit is contained in:
commit
1174dcb184
@ -57,7 +57,7 @@ class send_email_task extends scheduled_task {
|
||||
* Send out emails.
|
||||
*/
|
||||
public function execute() {
|
||||
global $DB, $PAGE;
|
||||
global $DB, $PAGE, $SITE;
|
||||
|
||||
// Get the maximum id we are going to use.
|
||||
// We use this as records may be added to the table while this task runs.
|
||||
@ -91,7 +91,7 @@ class send_email_task extends scheduled_task {
|
||||
}
|
||||
$conversations->close();
|
||||
if ($hascontent) {
|
||||
$subject = get_string('emaildigestsubject', 'message_email');
|
||||
$subject = get_string('messagedigestemailsubject', 'message_email', format_string($SITE->fullname));
|
||||
$message = $textrenderer->render($renderable);
|
||||
$messagehtml = $htmlrenderer->render($renderable);
|
||||
if (email_to_user($user, $noreplyuser, $subject, $message, $messagehtml)) {
|
||||
|
1
message/output/email/lang/en/deprecated.txt
Normal file
1
message/output/email/lang/en/deprecated.txt
Normal file
@ -0,0 +1 @@
|
||||
emaildigestsubject,message_email
|
@ -23,11 +23,11 @@
|
||||
*/
|
||||
|
||||
$string['email'] = 'Send email notifications to';
|
||||
$string['emaildigestsubject'] = 'Messages digest';
|
||||
$string['emaildigestunreadmessages'] = 'Unread messages';
|
||||
$string['emaildigestviewallmessages'] = 'View all messages';
|
||||
$string['emailonlyfromnoreplyaddress'] = 'Always send email from the no-reply address?';
|
||||
$string['ifemailleftempty'] = 'Leave empty to send notifications to {$a}';
|
||||
$string['messagedigestemailsubject'] = '{$a}: Messages digest';
|
||||
$string['pluginname'] = 'Email';
|
||||
$string['privacy:metadata:attachment'] = 'A file on the filesystem.';
|
||||
$string['privacy:metadata:attachname'] = 'The name of the attached file (extension indicates MIME).';
|
||||
@ -45,3 +45,5 @@ $string['privacy:metadata:subject'] = 'The subject line of the message.';
|
||||
$string['privacy:metadata:userfrom'] = 'The user sending the message.';
|
||||
$string['tasksendemail'] = 'Messages digest mailings';
|
||||
|
||||
// Deprecated since Moodle 3.9.
|
||||
$string['emaildigestsubject'] = 'Messages digest';
|
||||
|
@ -43,7 +43,7 @@ class core_message_send_email_task_testcase extends advanced_testcase {
|
||||
* Test sending email task.
|
||||
*/
|
||||
public function test_sending_email_task() {
|
||||
global $DB;
|
||||
global $DB, $SITE;
|
||||
|
||||
$this->preventResetByRollback(); // Messaging is not compatible with transactions.
|
||||
|
||||
@ -122,7 +122,8 @@ class core_message_send_email_task_testcase extends advanced_testcase {
|
||||
// Confirm it contains the correct data.
|
||||
$emails = $sink->get_messages();
|
||||
$email = reset($emails);
|
||||
$this->assertSame(get_string('emaildigestsubject', 'message_email'), $email->subject);
|
||||
$sitename = format_string($SITE->fullname);
|
||||
$this->assertSame(get_string('messagedigestemailsubject', 'message_email', $sitename), $email->subject);
|
||||
$this->assertSame($user2->email, $email->to);
|
||||
$this->assertNotEmpty($email->header);
|
||||
$emailbody = quoted_printable_decode($email->body);
|
||||
|
Loading…
x
Reference in New Issue
Block a user