#5362 closed defect (fixed)
Cannot make Trac produce HTML email notifications
Reported by: | Anton Melumad | Owned by: | Robert Corsaro |
---|---|---|---|
Priority: | highest | Component: | AnnouncerPlugin |
Severity: | major | Keywords: | |
Cc: | Trac Release: | 0.11 |
Description
I have installed the AnnouncerPlugin v0.2 but cannot manage to trigger HTML email notifications. Could be because of wrong configuration. The documentation states "For tickets, both a plain text and HTML formatter are currently supplied, and you may choose which you wish to receive in your preferences." but it does not mention how to specify the HTML or Text formatter.
Here is the log excerpt:
2009-06-10 19:48:01,296 Trac[email_distributor] DEBUG: EmailDistributor has found the following formats capable of handling 'email' of 'ticket': text/html, text/plain 2009-06-10 19:48:01,296 Trac[email_distributor] DEBUG: EmailDistributor was unable to find an address for: somebody (authenticated) 2009-06-10 19:48:01,296 Trac[email_distributor] DEBUG: EmailDistributor found the address 'xxxxx@…' for 'anton (authenticated)' via: SessionEmailResolver 2009-06-10 19:48:01,296 Trac[email_distributor] DEBUG: EmailDistributor is sending event as 'text/plain' to: xxxxx@…, xxxxx@…
Attachments (9)
Change History (43)
comment:1 Changed 15 years ago by
comment:2 Changed 15 years ago by
Hi,
I have the same problem with trac 0.11.3 - setting "text/html" as default_email_format doesn't change anything - all emails are just plain text :-(
ciao, Chris
comment:3 Changed 15 years ago by
It is working for me, but to be honest with you it is kind of pointless because of issue #3714.
comment:4 Changed 15 years ago by
Status: | new → assigned |
---|
comment:6 Changed 15 years ago by
Resolution: | duplicate |
---|---|
Status: | closed → reopened |
no, that didn't make sense.
comment:7 Changed 15 years ago by
Would be interested to hear your comments on #3714. Fixing this issue would be huge for the AnnouncerPlugin, but I imagine its difficult to do?
comment:8 Changed 15 years ago by
I'm still not receiving HTML email notifications even after installing the latest version of the AnnouncerPlugin trunk [7280] on Trac 0.12dev-r9098
.
Initially, the email was plain text even though I had specified html. I then set default_email_format = text/html
and now I receive a notification with html in the header, but not for the body of the comment.
So,
- It appears there is a minor issue whereby the user's preference is ignored if
default_email_format
is not specified. - It appears that in this case [7146] did not resolve this issue, or else I need to change a configuration.
As a test, I added the following as a comment:
Adding some wiki markup to see if it is formatted to HTML nicely.
Let's go to WikiStart.
And then look at Changeset [1].
And then look at Report {1}.
m = [m for m in milestones if milestone.is_overdue is False]
What I get is:
Some information about my development environment:
System Information Trac 0.12dev-r9098 Python 2.6.4 (r264:75706, Dec 7 2009, 18:43:55) [GCC 4.4.1] setuptools 0.6c11 pytz 2009l SQLite 3.6.16 pysqlite 2.5.5 Genshi 0.6dev-r1092 Babel - Pygments 1.0 Subversion 1.6.5 (r38866) jQuery: 1.3.2
I've enabled everything via the Plugin Admin panel
announcerplugin.api.announcementsystem = enabled announcerplugin.distributors.email_distributor.emaildistributor = enabled announcerplugin.formatters.ticket_email.ticketemailformatter = enabled announcerplugin.formatters.wiki_email.wikiemailformatter = enabled announcerplugin.pref.announcerpreferences = enabled announcerplugin.producers.attachment.attachmentchangeproducer = enabled announcerplugin.producers.ticket.ticketchangeproducer = enabled announcerplugin.producers.wiki.wikichangeproducer = enabled announcerplugin.resolvers.defaultdomain.defaultdomainemailresolver = enabled announcerplugin.resolvers.sessionemail.sessionemailresolver = enabled announcerplugin.resolvers.specified.specifiedemailresolver = enabled announcerplugin.subscribers.ticket_compat.carboncopysubscriber = enabled announcerplugin.subscribers.ticket_compat.legacyticketsubscriber = enabled announcerplugin.subscribers.ticket_compat.staticticketsubscriber = enabled announcerplugin.subscribers.ticket_components.ticketcomponentsubscriber = enabled announcerplugin.subscribers.ticket_custom.ticketcustomfieldsubscriber = enabled announcerplugin.subscribers.ticket_groups.joinablegroupsubscriber = enabled announcerplugin.subscribers.watch_users.userchangesubscriber = enabled announcerplugin.subscribers.watchers.watchsubscriber = enabled announcerplugin.subscribers.wiki.generalwikisubscriber = enabled
After getting Trac notifications working and renaming [notifications] -> [announcer], I added the following two options:
default_email_format = text/html email_address_resolvers = SpecifiedEmailResolver, SessionEmailResolver
Changed 15 years ago by
Attachment: | EmailNotification.png added |
---|
comment:9 Changed 15 years ago by
I guess the try/except
statement is failing. Any idea of why that might be happening?
comment:10 Changed 15 years ago by
Priority: | normal → highest |
---|---|
Severity: | normal → major |
comment:11 Changed 15 years ago by
Status: | reopened → new |
---|
comment:12 Changed 15 years ago by
Status: | new → assigned |
---|
comment:13 Changed 15 years ago by
Formatting log:
2009-06-10 19:48:01,296 Trac[email_distributor] DEBUG: EmailDistributor has found the following formats capable of handling 'email' of 'ticket': text/html, text/plain 2009-06-10 19:48:01,296 Trac[email_distributor] DEBUG: EmailDistributor was unable to find an address for: somebody (authenticated) 2009-06-10 19:48:01,296 Trac[email_distributor] DEBUG: EmailDistributor found the address 'xxxxx@xxxxx.xx' for 'anton (authenticated)' via: SessionEmailResolver 2009-06-10 19:48:01,296 Trac[email_distributor] DEBUG: EmailDistributor is sending event as 'text/plain' to: xxxxx@xxxxx.xx, xxxxx@xxxxx.xx
comment:14 Changed 15 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
This is working in trunk and merged into 0.11dev. 0.11dev will be merged to 0.11 after some testing. Please feel free to use 0.11dev and report any issues.
comment:17 Changed 15 years ago by
Resolution: | fixed |
---|---|
Status: | closed → reopened |
This still does not seem to be working for me after updating to 0.11dev [7594]. I've tested on and Trac 0.11.7stable-r9170
. I get the Comment in plain text: prefix to the comment from the failed try/catch.
Here is the log:
08:14:00 PM Trac[main] DEBUG: Dispatching <Request "POST u'/ticket/1'"> 08:14:00 PM Trac[api] DEBUG: AnnouncementSystem found the following subscribers capable of handling 'ticket, changed': TicketCustomFieldSubscriber, JoinableGroupSubscriber, UserChangeSubscriber, WatchSubscriber, LegacyTicketSubscriber, CarbonCopySubscriber, TicketComponentSubscriber 08:14:00 PM Trac[ticket_compat] DEBUG: LegacyTicketSubscriber added 'somebody (authenticated)' because of rule: always_notify_component_owner 08:14:00 PM Trac[ticket_compat] DEBUG: LegacyTicketSubscriber added 'ryano@physiosonics.com (not authenticated)' because of rule: always_notify_owner 08:14:00 PM Trac[ticket_compat] DEBUG: LegacyTicketSubscriber added 'anonymous (authenticated)' because of rule: always_notify_reporter 08:14:00 PM Trac[ticket_compat] DEBUG: LegacyTicketSubscriber added 'anonymous (authenticated)' because of rule: always_notify_updater 08:14:00 PM Trac[api] DEBUG: AnnouncementSystem has found the following subscriptions: [somebody(authenticated) via email], [ryano@physiosonics.com(not authenticated) via email], [anonymous(authenticated) via email] 08:14:00 PM Trac[email_distributor] DEBUG: EmailDistributor has found the following formats capable of handling 'email' of 'ticket': text/html, text/plain 08:14:00 PM Trac[email_distributor] DEBUG: EmailDistributor found the address 'anonymous@physiosonics.com' for 'anonymous (authenticated)' via: DefaultDomainEmailResolver 08:14:00 PM Trac[email_distributor] DEBUG: EmailDistributor found the address 'ryano@physiosonics.com' for 'None (not authenticated)' via: NoneType 08:14:00 PM Trac[email_distributor] DEBUG: EmailDistributor found the address 'somebody@physiosonics.com' for 'somebody (authenticated)' via: DefaultDomainEmailResolver 08:14:00 PM Trac[email_distributor] DEBUG: EmailDistributor is sending event as 'text/html' to: anonymous@physiosonics.com, ryano@physiosonics.com, somebody@physiosonics.com 08:14:03 PM Trac[email_distributor] DEBUG: EmailDistributor took 2.08 seconds to send. 08:14:03 PM Trac[api] DEBUG: AnnouncementSystem sent event in 2.22 seconds.
Here is the configuration from the [announcer]
section of trac.ini:
[announcer] admit_domains = always_notify_owner = true always_notify_reporter = true always_notify_updater = true default_email_format = text/html email_sender = SmtpEmailSender ignore_domains = mime_encoding = base64 sendmail_path = sendmail smtp_always_bcc = smtp_always_cc = smtp_default_domain = physiosonics.com smtp_enabled = true smtp_from = tracadmin@physiosonics.com smtp_from_name = Trac Admin smtp_password = XXXXXXX smtp_port = 587 smtp_replyto = tracadmin@physiosonics.com smtp_server = smtpx17.msoutlookonline.net smtp_subject_prefix = __default__ smtp_user = ryano@physiosonics.com ticket_subject_template = $prefix #$ticket.id: $summary use_public_cc = false use_short_addr = false use_tls = true
comment:18 Changed 15 years ago by
Forgot to include, the other version of Trac I've tested with is Trac 0.12dev-r9182
.
comment:19 Changed 15 years ago by
Hmm.. can you tell me what wiki text we are having trouble with? Past it in preformatted block please.
comment:20 Changed 15 years ago by
My test message is (I added the line numbers just now, so they won't appear in the images below):
1. Adding some wiki markup to see if it is formatted to HTML nicely ... 2. Let's go to WikiStart! 3. And then look at Changeset [1]! 4. And then look at Report {1}! 5. And then look at ticket #1! 6. And then look at milestone:1!!! 7. {{{ #!python m = [m for m in milestones if milestone.is_overdue is False] }}}
However, if I add a comment with just one of those 7 lines, I receive an email with 'Comment in plain text:', except for (1) which is already just plain text, and (7). Also of interest is that all the ticket fields labels are missing and their values shown as None, even though they are set for the ticket.
Changed 15 years ago by
Attachment: | FailsOnWikiMarkup.png added |
---|
Changed 15 years ago by
Attachment: | WikiProcessorMarkup.png added |
---|
comment:22 Changed 15 years ago by
I can't reproduce your missing labels error on 0.11dev. I'm using gmail for a client, how about you? But html wiki formatting is working now.
comment:23 Changed 15 years ago by
well, works better. the preformatted python still fails. I'm burnt for the day, I'll have a look tomorrow.
comment:24 Changed 15 years ago by
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
Changed 15 years ago by
Attachment: | ReceivingHtmlEmails.png added |
---|
comment:25 Changed 15 years ago by
Seems to be working as of [7609], with the exception of preformatting, as you already mentioned. I'm using Outlook for a client, and I'm receiving the ticket field labels on my 0.11.4 instance of Trac running on a hosting provider (CentOS 5 with Python 2.4) with the 0.11 branch of AnnouncerPlugin.
Changed 15 years ago by
Attachment: | ScreenCaptureFromGmail.png added |
---|
Changed 15 years ago by
Attachment: | ScreenCaptureFromGmail2.png added |
---|
comment:26 Changed 15 years ago by
Here is my latest test case, and a screen capture sent to Gmail. The comment appears to be in all italics, so you can't see markup that is in italics.
1. Adding some wiki markup to see if it is formatted to HTML nicely ... 2. Let's go to WikiStart! 3. And then look at Changeset [1]! 4. And then look at Report {1}! 5. And then look at ticket #1! 6. And then look at milestone:1!!! 7. {{{ #!python m = [m for m in milestones if milestone.is_overdue is False] }}} 8. Try some ''italics text''. 9. Try some '''bold text'''. 10. Create a traclink to the [source:/test/dir1/file1@1:2-3#L2 repository]. 11. Try some pre-formatted text to see {{{ If its the same as with the python code block ... If its the same as with the python code block ... If its the same as with the python code block ... If its the same as with the python code block ... If its the same as with the python code block ... If its the same as with the python code block ... If its the same as with the python code block ... If its the same as with the python code block ... If its the same as with the python code block ... If its the same as with the python code block ... }}}
comment:27 Changed 15 years ago by
To summarize, there are currently 3 (possibly 4) issues:
- Text of entire comment is in Italics.
- Pre-formatted code blocks are not displayed correctly.
- Pygments highlighting may not be working correctly.
- Possibly unrelated: I'm not seeing ticket field labels OR values.
comment:28 Changed 15 years ago by
Resolution: | fixed |
---|---|
Status: | closed → reopened |
I can't reproduce the ticket field labels and values problem. I tried announcer-trunk and announcer-0.11dev. Can you please try running it on trac-trunk with only announcerplugin installed to see if you can reproduce? Please make a new ticket for this issue if you can't figure it out.
As far as the styling of comments. I don't think it will ever be perfect. The Trac system relies heavily on the incoming request object and associated user session to render wiki text. The way I got it working is extremely hackish. I will try to remove the italics, but I'll leave the dirty work of making it look nice to someone who is better at things like that.
Changed 15 years ago by
Attachment: | DescriptionRendering.png added |
---|
Changed 15 years ago by
Attachment: | CommentsRendering.png added |
---|
comment:29 Changed 15 years ago by
For me (branch 0.11dev, latest r7718) ticket's description is not rendered correctly:
but further comments are:
The rendered text size is bigger than it should be but probably it's OK. Screenshots are captured in Gmail.
comment:30 Changed 15 years ago by
Try the description_format-0.patch. It needs to be cleaned up a little, but I'll commit something like it if it works for you.
comment:31 Changed 15 years ago by
Hmm, the patch is against announcer/formatters/ticket.py but there is no such file/directory in 0.11dev branch of trac-hacks.org SVN repository...
Changed 15 years ago by
Attachment: | description_format-0.patch added |
---|
comment:33 Changed 15 years ago by
Yes, it works! The only (minor) remaining problem is that the default font in Comments is bigger than it should be (see http://trac-hacks.org/attachment/ticket/5362/CommentsRendering.png). In the same time the font in Description has the correct size, precisely the same as in Trac's web interface.
I've seen in another comment a similar problem with a text shown in italic. Looks like the default font inherits some random attributes from elsewhere (size etc.) Maybe just to set them explicitly?
But again, even in the current state HTML renderer is quite usable. Thank you!
comment:34 Changed 14 years ago by
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
Do you have the following setting?
See AnnouncerPlugin#Distributors
default_email_format: This should be either 'text/plain' or 'text/html' and represents the default format that it sends email as. Users may override this in their preferences.