Hello,
I need to write code to send an email with an attachment to an user.
In Moodle 1.9 my code was using email_to_user.
Now with the new filestorage API, I need to upgrade my code.
email_to_user is expecting a full path from dataroot dir. I see nothing in the filestorage API to get this full path.
Maybe I am wrong but something seems missing to me in Moodle APIs either in moodlelib/email_to_user or in filestorage.
I searched moodle code but the only example I have is what Chardelle Busch has done in the certificate module replicating a private function of the filestorage lib (function certificate_path_from_hash). I am sure this is dangerous and the sky will fall on my head someday if i do this, and filestorage lib changes.
There must be some better way. I must be missing something in filestorageAPI
I looked at the new messaging library but the email output seems no to support attachments.
Unfortunately I can't use a link, I need to send a real attachment
Can somebody help me ?
Thanks a lot.