Move creating the temp directory out of the emailing for loop (#238)
This commit is contained in:
parent
9834d7f4b8
commit
97e44d3d1d
1 changed files with 6 additions and 6 deletions
|
@ -154,16 +154,16 @@ class email_certificate_task extends \core\task\scheduled_task {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Create a directory to store the PDF we will be sending.
|
||||||
|
$tempdir = make_temp_directory('certificate/attachment');
|
||||||
|
if (!$tempdir) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Now, email the people we need to.
|
// Now, email the people we need to.
|
||||||
foreach ($issuedusers as $user) {
|
foreach ($issuedusers as $user) {
|
||||||
$userfullname = fullname($user);
|
$userfullname = fullname($user);
|
||||||
|
|
||||||
// Create a directory to store the PDF we will be sending.
|
|
||||||
$tempdir = make_temp_directory('certificate/attachment');
|
|
||||||
if (!$tempdir) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Now, get the PDF.
|
// Now, get the PDF.
|
||||||
$template = new \stdClass();
|
$template = new \stdClass();
|
||||||
$template->id = $customcert->templateid;
|
$template->id = $customcert->templateid;
|
||||||
|
|
Loading…
Reference in a new issue