HTML Email notifications for Mantis 2.x

General discussion about MantisBT Plugins

Moderators: Developer, Contributor

Post Reply
acoder2020
Posts: 65
Joined: 11 Jan 2024, 19:32

HTML Email notifications for Mantis 2.x

Post 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?
cas
Posts: 1622
Joined: 11 Mar 2006, 16:08
Contact:

Re: HTML Email notifications for Mantis 2.x

Post 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
acoder2020
Posts: 65
Joined: 11 Jan 2024, 19:32

Re: HTML Email notifications for Mantis 2.x

Post 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?
acoder2020
Posts: 65
Joined: 11 Jan 2024, 19:32

Re: HTML Email notifications for Mantis 2.x

Post 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.
cas
Posts: 1622
Joined: 11 Mar 2006, 16:08
Contact:

Re: HTML Email notifications for Mantis 2.x

Post 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
acoder2020
Posts: 65
Joined: 11 Jan 2024, 19:32

Re: HTML Email notifications for Mantis 2.x

Post by acoder2020 »

WIll this (not)plugin be updated when 2.27 is released?

Thank you for making it available this way.
cas
Posts: 1622
Joined: 11 Mar 2006, 16:08
Contact:

Re: HTML Email notifications for Mantis 2.x

Post 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.
acoder2020
Posts: 65
Joined: 11 Jan 2024, 19:32

Re: HTML Email notifications for Mantis 2.x

Post by acoder2020 »

There is a templates folder in the core folder of the distributable. Does that need to be copied anywhere?
acoder2020
Posts: 65
Joined: 11 Jan 2024, 19:32

Re: HTML Email notifications for Mantis 2.x

Post 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.
cas
Posts: 1622
Joined: 11 Mar 2006, 16:08
Contact:

Re: HTML Email notifications for Mantis 2.x

Post 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.
Post Reply