Skip to content

Commit

Permalink
MDL-70130 core: allow to attach files from localrequestdir to emails
Browse files Browse the repository at this point in the history
Co-authored-by: Paul Holden <paulh@moodle.com>
  • Loading branch information
2 people authored and andrewnicols committed Nov 6, 2020
1 parent 8a9a4ee commit e30716a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/moodlelib.php
Expand Up @@ -6325,7 +6325,8 @@ function email_to_user($user, $from, $subject, $messagetext, $messagehtml = '',
$CFG->dataroot,
$CFG->dirroot,
$CFG->localcachedir,
$CFG->tempdir
$CFG->tempdir,
$CFG->localrequestdir,
]);
// Set addpath to true.
$addpath = true;
Expand Down
3 changes: 3 additions & 0 deletions lib/tests/moodlelib_test.php
Expand Up @@ -3446,6 +3446,9 @@ public function email_to_user_attachment_provider(): array {
'dirroot' => [$CFG->dirroot],
'localcachedir' => [$CFG->localcachedir],
'tempdir' => [$CFG->tempdir],
// Paths within $CFG->localrequestdir.
'localrequestdir_request_directory' => [make_request_directory()],
'localrequestdir_request_storage_directory' => [get_request_storage_directory()],
// Pass null to indicate we want to test a path relative to $CFG->dataroot.
'relative' => [null]
];
Expand Down

0 comments on commit e30716a

Please sign in to comment.