Page 1 of 2
HTML Email notifications for Mantis 2.x
Posted: 12 Mar 2024, 18:40
by acoder2020
One of the main reasons my team wants to migrate away from TRAC is the nearly unreadable email notifications. Trac has an HTML Email plugin, but it is in Python with a lot of versioning/dependency issues (more reason for us to get off of Trac)
There was an HTMLmail plugin for Mantis 1.x, but that won't work with Mantis 2.x.
Lots of long rambling posts here about possibilities of a plugin, but the last meaningful replies are from 2017. It looked like the end users became fatigued asking for this feature with no movement other than a plugin that seems unfinished with no documentation or standardized install instructions. Also the last version of that plugin was broken with 2.26.0 due to changes in email_api.php. I can see why that plugin developer walked away from the project.
Can we revisit this issue? How can we easily get HTML in emails? Are there any newer plugins in development?
Re: HTML Email notifications for Mantis 2.x
Posted: 13 Mar 2024, 08:06
by cas
I did create an option to define your own templates for emails (2023) but that does require some adjustments in core files.
Have a look here
https://mantisbt.org/forums/viewtopic.php?p=74209
Re: HTML Email notifications for Mantis 2.x
Posted: 13 Mar 2024, 13:29
by acoder2020
There are 5 pages of replies (I skimmed through). Is there stand-alone documentation with just the core needed info and not all the extra banter?
Re: HTML Email notifications for Mantis 2.x
Posted: 13 Mar 2024, 13:55
by cas
Re: HTML Email notifications for Mantis 2.x
Posted: 13 Mar 2024, 19:22
by acoder2020
Readme references an older version. Is this still good with 2.26 and newer?
in case you are running 2.25.2:
Now copy the core directory of this distribution to your Mantis installation.
In case you are running another version 2.x:
Copy template_api.php from the core directory of the distribution to the core directory of your mantis installation.
Make a backup copy of emial_api.php in the core directory of your mantis installation.
Next make same changes as found in my version of email_api.php.
Re: HTML Email notifications for Mantis 2.x
Posted: 14 Mar 2024, 08:37
by cas
Here you can find it all:
https://github.com/mantisbt-plugins/mailtemplate
Also added a fully prepared emai_api.php for version 2.26
Re: HTML Email notifications for Mantis 2.x
Posted: 14 Mar 2024, 14:49
by acoder2020
WIll this (not)plugin be updated when 2.27 is released?
Thank you for making it available this way.
Re: HTML Email notifications for Mantis 2.x
Posted: 14 Mar 2024, 15:53
by cas
In principal all changes are documented so one could do it themselves. However chance is qute big that I wwill need for 2.27 myself. If that indeed is the case, I will make it available.
Re: HTML Email notifications for Mantis 2.x
Posted: 14 Mar 2024, 19:36
by acoder2020
There is a templates folder in the core folder of the distributable. Does that need to be copied anywhere?
Re: HTML Email notifications for Mantis 2.x
Posted: 14 Mar 2024, 19:48
by acoder2020
Additionally, there's a template_api.php file, but the instructions only say to touch it if on a version other than 2.25 or 2.26.
To confirm, is template_api.php not needed for 2.26?
Please make a backup of the following files from your mantis installation:
config/config_inc.php ( entries need to be added )
core/email_api.php ( here i made changes to core, marked with "## CN" )
In case you are running 2.25 or 2.26, copy the correspong email_api.php into the core directory of your Mantisbt installation.
Ensure you rename it again to "email_api.php"
In case you are running a different version from 2.25 or 2.26:
Copy template_api.php from the core directory of the distribution to the core directory of your mantis installation.
Make a backup copy of email_api.php in the core directory of your mantis installation.
Next make same changes as found in my version of email_api.php (changes have been marked with "## CN").
Nothing will change yet, everything works as before.
Next open up entries-config_inc.php and add these to your mail settings in your config_inc.php.
As of now the adjusted scripts will kick in.
Re: HTML Email notifications for Mantis 2.x
Posted: 14 Mar 2024, 21:11
by cas
Yep there was a line missing:
In addition, copy template_api.php from the core directory of the distribution into the core directory of your mantis installation.
For further issues/rearks/requests, please use github.
Re: HTML Email notifications for Mantis 2.x
Posted: 03 Sep 2024, 08:13
by RokeJulianLockhart
acoder2020 wrote: 14 Mar 2024, 19:48
Additionally, there's a template_api.php file, but the instructions only say to touch it if on a version other than 2.25 or 2.26.
To confirm, is template_api.php not needed for 2.26?
Please make a backup of the following files from your mantis installation:
config/config_inc.php ( entries need to be added )
core/email_api.php ( here i made changes to core, marked with "## CN" )
In case you are running 2.25 or 2.26, copy the correspong email_api.php into the core directory of your Mantisbt installation.
Ensure you rename it again to "email_api.php"
In case you are running a different version from 2.25 or 2.26:
Copy template_api.php from the core directory of the distribution to the core directory of your mantis installation.
Make a backup copy of email_api.php in the core directory of your mantis installation.
Next make same changes as found in my version of email_api.php (changes have been marked with "## CN").
Nothing will change yet, everything works as before.
Next open up entries-config_inc.php and add these to your mail settings in your config_inc.php.
As of now the adjusted scripts will kick in.
I happened to ask
https://mantisbt.org/bugs/view.php?id=1400#c69153 before locating this thread. As a user of multiple MantisBT instances, is the sole way to have notification e-mails be readable on vertical displays asking each instance to maintain an HTML message template? That doesn't seem like it'll scale well.
Re: HTML Email notifications for Mantis 2.x
Posted: 03 Sep 2024, 15:35
by cas
Well first of all, you always need to template_api.php.
The templates itself can be used in primciple on each instance.
So once developed, you are done

Re: HTML Email notifications for Mantis 2.x
Posted: 03 Sep 2024, 16:44
by acoder2020
cas wrote: 03 Sep 2024, 15:35
Well first of all, you always need to template_api.php.
The templates itself can be used in primciple on each instance.
So once developed, you are done
Until the next update

Re: HTML Email notifications for Mantis 2.x
Posted: 04 Sep 2024, 12:05
by cas
untill integrated in standard mantis
