Opened 9 years ago

Closed 9 years ago

Last modified 8 years ago

#4202 closed enhancement (fixed)

attachment link and text to html

Reported by: georgesoon Owned by: Robert Corsaro
Priority: normal Component: AnnouncerPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.11



  • add link to attachment in mail
  • try covert some wiki format text to html
    • unfortunately I do not know how to cope with trac links
    • because there is no req used in announcer, so I can not set context with wiki_to_html


  • ticket_email_mimic.html (attachment link)

reference changes in

            temp = wiki_to_html(event.comment, self.env, None)
            temp = 'Comment in plain text: %s ' %(event.comment) 
        data = dict(
            ticket = ticket,
            author =,
            header = self.ticket_email_header_fields,
            comment = temp,
            category = event.category,
            ticket_link = self.env.abs_href('ticket',,
            project_name = self.env.project_name,
            project_desc = self.env.project_description,
            project_link = self.env.project_url or self.env.abs_href(),
            has_changes = short_changes or long_changes,
            long_changes = long_changes,
            short_changes = short_changes,
            attachment= event.attachment,
            attachment_link = self.env.abs_href('attachment/ticket',

Attachments (2)

my-patch.diff (2.3 KB) - added by georgesoon@… 9 years ago.
svn diff for
my-patch-for-email_mimic.diff (943 bytes) - added by georgesoon 9 years ago.
svn diff for ticket_email_mimic.html

Download all attachments as: .zip

Change History (8)

comment:1 Changed 9 years ago by Robert Corsaro

Can you upload a unified diff? I don't know what this is supposed to mean.

Changed 9 years ago by georgesoon@…

Attachment: my-patch.diff added

svn diff for

comment:2 Changed 9 years ago by georgesoon@…

  • I made this modification on an older version of the announcer
  • and I tried the description could be formatted to html style from plain text as well by
           ticket['description'] = wiki_to_html(ticket['description'], self.env, None)

Just for your reference

Changed 9 years ago by georgesoon

svn diff for ticket_email_mimic.html

comment:3 Changed 9 years ago by Robert Corsaro

Status: newassigned

How'd I miss this? I'll try and give it a whirl tonight.

comment:4 Changed 9 years ago by Robert Corsaro

Resolution: fixed
Status: assignedclosed

(In [7146]) Process wiki to html and add attachments fixes #4202

comment:5 Changed 8 years ago by Robert Corsaro

(In [7574]) Process wiki to html and add attachments

fixes #4202 merge -r7146

comment:6 Changed 8 years ago by anonymous

My ticket descriptions are being formatted in plain text. I see the message "Comment in plain text: None" at the end, which I believe means I am falling to the exception case added in [7574], but I'm unsure why. I turned on debugging, but I see nothing of significance in the log. Everything looks good in it.

Which version of Trac has this been tested against? I am using Trac 0.11.7rc1.

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain Robert Corsaro.
The resolution will be deleted.

Add Comment

E-mail address and name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.