Skip to content

Commit

Permalink
added mtrace statement for logging failed mails (#214)
Browse files Browse the repository at this point in the history
  • Loading branch information
NinaHerrmann authored Jun 11, 2024
1 parent bd2aca6 commit 05ff0e2
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions step/email/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,15 +121,18 @@ public function post_processing_bulk_operation() {

$parsedsettings = $this->replace_placeholders($settings, $user, $step->id, $mailentries);

$subject = $parsedsettings['subject'];
$content = $parsedsettings['content'];
$contenthtml = $parsedsettings['contenthtml'];
// TODO: use course info to parse content template!
email_to_user($user, \core_user::get_noreply_user(), $subject, $content, $contenthtml);
$DB->delete_records('lifecyclestep_email',
$subject = $parsedsettings['subject'];
$content = $parsedsettings['content'];
$contenthtml = $parsedsettings['contenthtml'];
// TODO: use course info to parse content template!
$success = email_to_user($user, \core_user::get_noreply_user(), $subject, $content, $contenthtml);
if (!$success) {
mtrace("E-mail to user {$user->id} failed.");
}
$DB->delete_records('lifecyclestep_email',
['instanceid' => $step->id,
'touser' => $user->id, ]);
$transaction->allow_commit();
$transaction->allow_commit();
}
}

Expand Down

0 comments on commit 05ff0e2

Please sign in to comment.