Quantcast
Channel: General developer forum
Viewing all articles
Browse latest Browse all 37670

Email attachments require file path in dataroot

$
0
0
by Yuliya Bozhko.  

Hi,

Would appreciate any help on the following issue.

I am working on open badges project and one of the things that I need to do is to send emails to users with the badges they earned. Generating an email is not a problem at all, but apparently adding an email attachment is.

I was going to use email_to_user() which seems to be perfect for what I want to do. It has $attachment as a parameter which is supposed to be a (string) path to "a file on the filesystem, relative to $CFG->dataroot".

However, looking at this discussion https://moodle.org/mod/forum/discuss.php?d=200118, I understand that getting this very filepath through File API (or any other way) is not possible at all... Am I missing something here? What is the point of having such an option in email_to_user() if it can never be used? And is there any  workaround solution for this problem?

Thanks!

Yuliya


Viewing all articles
Browse latest Browse all 37670

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>