Opened 11 years ago

Closed 10 years ago

# Customize email2trac post format

Reported by: Owned by: andrew.hanenkamp@… bas normal EmailtoTracScript normal andrew.hanenkamp@… 0.8

### Description

I'm not particularly excited about the way email2trac formats the messages. It looks fine from the web interface, but the use of braces and other Wiki formatting just looks like noise when rendered in plain text. I'm going to patch my email2trac script to get the formatting I'd like in the meantime.

However, it would be nice if email2trac took advantage of the templating system and I could just drop one or more templates into the templates/ directory to alter the way posts get placed in the system.

### comment:1 Changed 11 years ago by anonymous

• Cc andrew.hanenkamp@… added; anonymous removed
• Owner changed from bas to anonymous
• Status changed from new to assigned

You can always mail me the "new" layout and maybe make a config option for it. Second i am not that familiar wih the template system, but it sounds nice. You can already specify an template for the rendering o the tickets

### comment:2 Changed 11 years ago by bas

• Owner changed from anonymous to bas
• Status changed from assigned to new

### comment:3 Changed 11 years ago by andrew.hanenkamp@…

Part of my problem is that I had the reply-to mailto link turned on. Turning that off helped considerably.

I looked into using the templating system briefly based upon what the TicketNotifyEmail class does. It looks like you need to instantiate the HDFWrapper class, perform some initialization and then call the render() method of that class with the name of the template.

I stopped before really doing anything, so that's as far as I know. I wasn't sure how the .cs file had variables passed into it. The main reason I stopped is because I think there's a bit of logic that needs to be reorganized while iterating through the message parts. I didn't see an obvious way of grouping things together to make a single template do the work of several tkt['description'] = ... lines. Since my job is to manage a project with a looming deadline, I decided to opt for the simple solution and bug-out for now.

However, if this bug is still open in a couple months, I may take an interest in coming back to it.

Cheers,
Andrew

### comment:4 Changed 11 years ago by anonymous

• Severity changed from minor to normal
• Trac Release set to 0.8

Hi,

I setup this plugin and am impressed with the way it looks in the trac interface, but unfortunately the message it sends to clients who send in emails doesn't look very good at all, including the raw wiki format in a text email isn't useful, and the format of the headers can easily get screwed up (try it from gmail sometime to get a shock).

### comment:5 Changed 11 years ago by anonymous

Glad you like the email2trac package, but is is always a problem the layout.

What options did you have enabled and do you have suggestions to improve the layout?

### comment:6 Changed 11 years ago by micah@…

I too like email2trac, and have also had the same experience as others in this ticket about the layout. Let me try to describe my impressions.

When a user sends an email to the ticket submission email, they get back the following:

#20: another test
-----------------------------------------------+----------------------------
Reporter:  "micah milano" <micahox@gmail.com>  |       Owner:  micah
Type:  defect                             |      Status:  new
Priority:  major                              |   Milestone:
Component:  Support                            |     Version:
-----------------------------------------------+----------------------------
'''To:''' support2@mytrac.coop [[BR]]
{{{
This is what the ticket email looks like in plain text

}}}

--
Ticket URL: <http://wiki.mytrac.coop/eggplant/ticket/20>
Mytrac <http://wiki.mytrac.coop/eggplant>
Mytrac wiki


As you can see there are a few problems here:

1. The top of the message contains useful information, however due to the reporter's email, the formatting of the tables is askew
2. The first line after the ticket header is a To: line, which is escaped for the wiki, but looks really odd in plain text (especially with the BR tag). I'm not even sure why this is here.
3. The body of the message contains the three curly braces which is useful in wiki mark-up, but not very pretty in plain-text email.

If I submitted a ticket via email, I would expect the following to happen:

1. I get a response from the system that says something like:
Subject: [<project>] Ticket #20: <ticket subject here>

Hello,

We have received the ticket you have submitted and it has been filed into our ticket system as ticket number: #20. You can track the status of this ticket here: <http://wiki.mytrac.coop/eggplant/ticket/20>

A copy of your submission is included below.

Thanks!
Our project
Mytrac <http://wiki.mytrac.coop/eggplant>



### comment:7 Changed 11 years ago by micah@…

oops, I forgot to add to one of the problems above:

1. The email that you receive in response is just a copy of what you sent, rather than an acknowledgement that what you sent was received. There is a slight difference here, but the difference is between someone who is confused, and someone who understands whats going on. When I've had people email in tickets, and they get that response, they think that it was bounced back to them. :P

### comment:8 Changed 11 years ago by anonymous

• Owner changed from bas to anonymous
• Status changed from new to assigned

Thanks for the input. The following comment:

• The top of the message contains useful information, however due to the reporter's email, the formatting of the tables is askew
This the notification format from trac. I only use it. We can make an option you
report only the name or email-address.

• The first line after the ticket header is a To: line, which is escaped for the wiki, but looks really odd in plain text (especially with the BR tag). I'm not even sure why this is here
You can get rid of that (see documentation mailto_link : 0)

• The body of the message contains the three curly braces which is useful in wiki mark-up, but not very pretty in plain-text email.
I also can make an option for this to disable this. Do not expect to have a
better format. If a user as Captials or other special wiki characters. It
also looks weird


For the last

1. The email that you receive in response is just a copy of what you sent,rather
than a acknowledgement that what you sent was received. There is a slight
ifference here, but the difference is between someone who is confused, and someone
who understands whats going on. When I've had people email in tickets, and they get
that response, they think that it was bounced back to them. :P


You do want notifcation enabled, but just sent a custom messsage to the reported then a ticket has been submitted. There is an option to enable your own notification template. I do not made use of it yet. But that is an option to allow another ticket format notification.

### comment:9 Changed 11 years ago by micah@…

Thanks for the input. The following comment:

* The top of the message contains useful information, however due to the
reporter's email, the formatting of the tables is askew
{{{
This the notification format from trac. I only use it. We can make an
option you report only the name or email-address.
}}}


This might be a nice solution, although it would maybe be better to just eliminate the table "borders" that are in the trac notification. That way they can never be pushed over so they are misaligned...

* The first line after the ticket header is a To: line, which is escaped
for the wiki, but looks really odd in plain text (especially with the BR tag). I'm not even sure why this is here

{{{
You can get rid of that (see documentation mailto_link : 0)
}}}


You are right that I can get rid of that, but wrong that it is the mailto_link option, its actually the email_header option :)

* The body of the message contains the three curly braces which is useful
in wiki mark-up, but not very pretty in plain-text email.

{{{
I also can make an option for this to disable this. Do not expect to have
a better format. If a user as Captials or other special wiki characters. It
also looks weird
}}}


Yes, I see, it would be best to turn off all wiki formatting as the camelcase and curly braces, etc. do not turn out well in any text email, or even html email.

For the last
{{{
1. The email that you receive in response is just a copy of what you
sent,rather than a acknowledgement that what you sent was received. There is a slight
difference here, but the difference is between someone who is confused, and someone
who understands whats going on. When I've had people email in tickets, and
they get that response, they think that it was bounced back to them. :P
}}}

You do want notifcation enabled, but just sent a custom messsage to the reported then a ticket has been submitted. There is an option to enable your own notification
template. I do not made use of it yet. But that is an option to allow another ticket format notification.


Yes, I want a custom email notification sent when someone submits a ticket. However, they should be able to receive any replies or updates to their tickets from me via email or the web, and they should also be able to send replies and updates to their own tickets.

### comment:10 Changed 11 years ago by anonymous

• Owner changed from anonymous to bas
• Status changed from assigned to new

### comment:11 Changed 10 years ago by bas

They can always receive email if a ticket is update via de web or mail. Just configure the notification section always notify reporter.

### comment:12 in reply to: ↑ description Changed 10 years ago by dminstrel@…

Could this be solved by simply making the "email2trac {{ }}" markup optional in email2trac.conf? We use Trac as a helpdesk with tickets submitted through email. For us the email2trac markup added to each new ticket is just adding noise that confuse users when they review their tickets.

### comment:13 Changed 10 years ago by anonymous

I shall make it an option to disable the style. A side note is that the text will be interpreted as wiki markup language on the web pages

### comment:14 follow-up: ↓ 15 Changed 10 years ago by bas

• Status changed from new to assigned

Just commited it to the trunk version:

• verbatim_format

default is 1 and to disable it set it to 0.

Can you test it?

### comment:15 in reply to: ↑ 14 Changed 10 years ago by anonymous

I tried it. It works fine but it still adds "email2trac:" to the ticket. Can the option remove that too? Thanks!

### comment:16 Changed 10 years ago by bas

email2trac is also removed in the trunk version

### comment:17 Changed 10 years ago by bas

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

New version 0.9