How to support HTML-formatted e-mail content

66 views
Skip to first unread message

Mingxing Tian

unread,
Jun 6, 2016, 5:06:42 AM6/6/16
to Trac Users
Default supports only plain text messages, but this style is ugly, I want to use HTML module to send e-mail, ask how to achieve?

RjOllos

unread,
Jun 6, 2016, 5:09:59 AM6/6/16
to Trac Users


On Monday, June 6, 2016 at 2:06:42 AM UTC-7, Mingxing Tian wrote:
Default supports only plain text messages, but this style is ugly, I want to use HTML module to send e-mail, ask how to achieve?



Roger Oberholtzer

unread,
Jun 7, 2016, 2:18:54 AM6/7/16
to trac-...@googlegroups.com
On Mon, Jun 6, 2016 at 11:09 AM, RjOllos <rjo...@gmail.com> wrote:

> You could try: https://trac-hacks.org/wiki/TracHtmlNotificationPlugin

OOC, is the component really:

trachtmlnotification.* = enabled


Or is that a typo?

--
Roger Oberholtzer

Ryan Ollos

unread,
Jun 7, 2016, 2:28:20 AM6/7/16
to Trac Users

Looks correct. You can confirm by checking the entry_points:

 

Roger Oberholtzer

unread,
Jun 7, 2016, 4:00:25 AM6/7/16
to trac-...@googlegroups.com
On Tue, Jun 7, 2016 at 8:28 AM, Ryan Ollos <rjo...@gmail.com> wrote:

> Looks correct. You can confirm by checking the entry_points:
> https://trac-hacks.org/browser/trachtmlnotificationplugin/0.12/setup.py

My mistake. I read it as starting with 'trach' for the trac part of
the name. I did look more than once.

The real problem is that when I use it with Trac 1.0.2, I get this in
the log, and no e-mail sent:

ConfigurationError: Cannot find an implementation of the
<tt>IEmailSender</tt> interface named
<tt>HtmlNotificationSmtpEmailSender</tt>. Please check that the
Component is enabled or update the option <tt>[announcer]
email_sender</tt> in trac.ini.

I have this in [components]

trachtmlnotification.* = enabled

and this in [announcer]

email_sender = HtmlNotificationSmtpEmailSender

When that did not work, I also added:

[notification]
email_sender = HtmlNotificationSmtpEmailSender


But still no joy.


--
Roger Oberholtzer

RjOllos

unread,
Jun 7, 2016, 1:30:14 PM6/7/16
to Trac Users
TracHtmlNotificationPlugin probably won't work with AnnouncerPlugin, but AnnouncerPlugin can send HTML notifications anyway.

The reason is, HtmlNotificationSmtpEmailSender implements the trac.notification.IEmailSender interface. This is a different interface from announcer.distributors.mail.IEmailSender:

- Ryan

Roger Oberholtzer

unread,
Jun 8, 2016, 5:12:00 AM6/8/16
to trac-...@googlegroups.com
If I enable HTML for me for Announcer
(Preferences->Subscriptions->email rules->Format), I do not get
e-mails for tickets, and I see this in the trac log.

2016-06-08 11:05:57,218 Trac[api] WARNING: HTML preview using
Graphviz failed:


--
Roger Oberholtzer

RjOllos

unread,
Jun 8, 2016, 2:24:52 PM6/8/16
to Trac Users
That warning message is unrelated.

Have you upgraded to the latest version of AnnouncerPlugin?

- Ryan 
Reply all
Reply to author
Forward
0 new messages