Modify

Opened 6 years ago

Closed 5 years ago

Last modified 4 years ago

#4202 closed enhancement (fixed)

attachment link and text to html

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

Description

features:

  • 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

changeset

  • ticket_email.py
  • ticket_email_mimic.html (attachment link)

reference changes in ticket_email.py

        try:
            temp = wiki_to_html(event.comment, self.env, None)
        except:
            temp = 'Comment in plain text: %s ' %(event.comment) 
        data = dict(
            ticket = ticket,
            author = event.author,
            header = self.ticket_email_header_fields,
            comment = temp,
            category = event.category,
            ticket_link = self.env.abs_href('ticket', ticket.id),
            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',ticket.id)
        )

Attachments (2)

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

Download all attachments as: .zip

Change History (8)

comment:1 Changed 6 years ago by doki_pen

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

Changed 6 years ago by georgesoon@…

svn diff for ticket_email.py

comment:2 Changed 6 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
       try:
           ticket['description'] = wiki_to_html(ticket['description'], self.env, None)
    
    

Just for your reference

Changed 6 years ago by georgesoon

svn diff for ticket_email_mimic.html

comment:3 Changed 5 years ago by doki_pen

  • Status changed from new to assigned

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

comment:4 Changed 5 years ago by doki_pen

  • Resolution set to fixed
  • Status changed from assigned to closed

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

comment:5 Changed 4 years ago by doki_pen

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

fixes #4202
merge -r7146

comment:6 Changed 4 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.

Add Comment

Modify Ticket

Action
as closed .
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from doki_pen. Next status will be 'closed'.
The resolution will be deleted. Next status will be 'reopened'.
Author


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

 
Note: See TracTickets for help on using tickets.