Modify

Opened 16 years ago

Closed 15 years ago

Last modified 15 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

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@… 16 years ago.
svn diff for ticket_email.py
my-patch-for-email_mimic.diff (943 bytes) - added by georgesoon 16 years ago.
svn diff for ticket_email_mimic.html

Download all attachments as: .zip

Change History (8)

comment:1 Changed 16 years ago by Robert Corsaro

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

Changed 16 years ago by georgesoon@…

Attachment: my-patch.diff added

svn diff for ticket_email.py

comment:2 Changed 16 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 16 years ago by georgesoon

svn diff for ticket_email_mimic.html

comment:3 Changed 15 years ago by Robert Corsaro

Status: newassigned

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

comment:4 Changed 15 years ago by Robert Corsaro

Resolution: fixed
Status: assignedclosed

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

comment:5 Changed 15 years ago by Robert Corsaro

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

fixes #4202 merge -r7146

comment:6 Changed 15 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
Action
as closed The owner will remain Robert Corsaro.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


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

 
Note: See TracTickets for help on using tickets.