Page 1 of 1

Email notification with attachment

Posted: 16 Aug 2021, 05:02
by rdlmantisbt
Hi, I would like to know how can I add a hyperlink to the attachment sent via email.
What I would like to achieve is, if an issue with attachment is submitted, the email notification should have a hyperlink which the users can download via email. In the example below, I want 'test attachment.png' to be a hyperlink.

Thanks!

Re: Email notification with attachment

Posted: 16 Aug 2021, 11:58
by cas
This is not available out of the box. You would need to customize the email message ( the required link is easy enough to pull together). It does require users to have access to mantis and enough rights :mrgreen:

Re: Email notification with attachment

Posted: 17 Aug 2021, 05:21
by rdlmantisbt
Thanks, cas! How do I do that? Which are the files that I should customize?

I looked at email_api.php and file_download.php looking for <a> tag to modify :D

Re: Email notification with attachment

Posted: 17 Aug 2021, 15:30
by cas
you were on the right track, it is email_api.php.
Find function email_bugnote_add , there you see that the attachments are added to the overview.
Rather than storing the name, you should store an url.
In core/print_api.php you can find function print_bug_attachment_header which will generate a download link.
So now you have some pieces of the puzzle, have fun :mrgreen:

Re: Email notification with attachment

Posted: 19 Aug 2021, 06:03
by rdlmantisbt
Thank you very much! :D