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!
Email notification with attachment
Moderators: Developer, Contributor
-
- Posts: 3
- Joined: 16 Aug 2021, 04:55
Email notification with attachment
- Attachments
-
- email attachment.png (8.95 KiB) Viewed 3509 times
Re: Email notification with attachment
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 

-
- Posts: 3
- Joined: 16 Aug 2021, 04:55
Re: Email notification with attachment
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
I looked at email_api.php and file_download.php looking for <a> tag to modify

Re: Email notification with attachment
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
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

-
- Posts: 3
- Joined: 16 Aug 2021, 04:55
Re: Email notification with attachment
Thank you very much! 
