Changes between Version 3 and Version 4 of TracNotification
- Timestamp:
- 09/24/12 18:52:15 (13 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
TracNotification
v3 v4 31 31 * '''`smtp_from`''': Email address to use for ''Sender''-headers in notification emails. 32 32 * '''`smtp_from_name`''': Sender name to use for ''Sender''-headers in notification emails. 33 * '''`smtp_from_author`''': (''since 1.0'') Use the author of a change (the reporter of a new ticket, or the author of a comment) as the `From:` header value in notification e-mails (default: false). If the author hasn't set an e-mail address, `smtp_from` and `smtp_from_name` are used instead. 33 34 * '''`smtp_replyto`''': Email address to use for ''Reply-To''-headers in notification emails. 34 35 * '''`smtp_default_domain`''': (''since 0.10'') Append the specified domain to addresses that do not contain one. Fully qualified addresses are not modified. The default domain is appended to all username/login for which an email address cannot be found from the user settings. … … 49 50 * '''`email_sender`''': (''since 0.12'') Name of the component implementing `IEmailSender`. This component is used by the notification system to send emails. Trac currently provides the following components: 50 51 * `SmtpEmailSender`: connects to an SMTP server (default). 51 * `SendmailEmailSender`: runs a `sendmail`-compatible executable. 52 * `SendmailEmailSender`: runs a `sendmail`-compatible executable. 52 53 53 54 Either '''`smtp_from`''' or '''`smtp_replyto`''' (or both) ''must'' be set, otherwise Trac refuses to send notification mails. … … 98 99 === Customizing the e-mail content === 99 100 100 The notification e-mail content is generated based on `ticket_notify_email.txt` in `trac/t icket/templates`. You can add your own version of this template by adding a `ticket_notify_email.txt` to the templates directory of your environment. The default looks like this:101 The notification e-mail content is generated based on `ticket_notify_email.txt` in `trac/templates`. You can add your own version of this template by adding a `ticket_notify_email.txt` to the templates directory of your environment. The default looks like this: 101 102 102 103 {{{ 103 104 $ticket_body_hdr 104 105 $ticket_props 105 {% choose ticket.new %}\ \106 {% when True %}\ \106 {% choose ticket.new %}\ 107 {% when True %}\ 107 108 $ticket.description 108 {% end %}\ \109 {% otherwise %}\ \110 {% if changes_body %}\ \109 {% end %}\ 110 {% otherwise %}\ 111 {% if changes_body %}\ 111 112 ${_('Changes (by %(author)s):', author=change.author)} 112 113 113 114 $changes_body 114 {% end %}\ \115 {% if changes_descr %}\ \116 {% if not changes_body and not change.comment and change.author %}\ \115 {% end %}\ 116 {% if changes_descr %}\ 117 {% if not changes_body and not change.comment and change.author %}\ 117 118 ${_('Description changed by %(author)s:', author=change.author)} 118 {% end %}\ \119 {% end %}\ 119 120 $changes_descr 120 121 -- 121 {% end %}\ \122 {% if change.comment %}\ \122 {% end %}\ 123 {% if change.comment %}\ 123 124 124 125 ${changes_body and _('Comment:') or _('Comment (by %(author)s):', author=change.author)} 125 126 126 127 $change.comment 127 {% end %}\ \128 {% end %}\ \129 {% end %}\ \128 {% end %}\ 129 {% end %}\ 130 {% end %}\ 130 131 131 132 -- … … 170 171 }}} 171 172 172 with this instead :173 with this instead (''requires Python 2.6 or later''): 173 174 {{{ 174 175 -------------------------------------------------------------------------- … … 176 177 pv = [(a[0].strip(), a[1].strip()) for a in [b.split(':') for b in 177 178 [c.strip() for c in 178 ticket_props.replace('|', '\ \n').splitlines()[1:-1]] if ':' in b]];179 ticket_props.replace('|', '\n').splitlines()[1:-1]] if ':' in b]]; 179 180 sel = ['Reporter', 'Owner', 'Type', 'Status', 'Priority', 'Milestone', 180 'Component', 'Severity', 'Resolution', 'Keywords'] %}\ \181 ${'\ \n'.join('%s\\t%s' % (format(p[0]+':', ' <12'), p[1]) for p in pv if p[0] in sel)}182 {% end %}\ \181 'Component', 'Severity', 'Resolution', 'Keywords'] %}\ 182 ${'\n'.join('%s\t%s' % (format(p[0]+':', ' <12'), p[1]) for p in pv if p[0] in sel)} 183 {% end %}\ 183 184 -------------------------------------------------------------------------- 184 185 }}} … … 220 221 }}} 221 222 222 However, it's not as perfect as an HTML formatted e-mail would be, but presented ticket properties are at least readable... 223 **Important**: Only those ticket fields that are listed in `sel` are part of the HTML mail. If you have defined custom ticket fields which shall be part of the mail they have to be added to `sel`, example: 224 {{{ 225 sel = ['Reporter', ..., 'Keywords', 'Custom1', 'Custom2'] 226 }}} 227 228 However, it's not as perfect as an automatically HTML-formatted e-mail would be, but presented ticket properties are at least readable by default in MS Outlook... 223 229 224 230
