Changes between Version 9 and Version 10 of WorkflowNotificationPlugin


Ignore:
Timestamp:
Jan 30, 2013, 1:46:11 PM (11 years ago)
Author:
ejucovy
Comment:

How to use blank lines in the emails

Legend:

Unmodified
Added
Removed
Modified
  • WorkflowNotificationPlugin

    v9 v10  
    8787[ticket-workflow-notifications]
    8888notify_reporter_when_accepted = accept
    89 notify_reporter_when_accepted.body = Hi $ticket.reporter, '$ticket.summary' has been accepted
    90                                                              by $change.author. Its status is now $ticket.status.
    91                                                              
    92                                                              {% if change.comment %}$change.author said:
    93                                                              $change.comment{% end %}
    94                                                              -----
    95                                                              Ticket URL: $link
    96                                                              $project.name <${project.url or abs_href()}>
    97                                                              $project.descr
     89notify_reporter_when_accepted.body = Hi $ticket.reporter, '$ticket.summary' has been accepted \nby $change.author. Its status is now $ticket.status. \n\n{% if change.comment %}$change.author said:\n$change.comment{% end %}\n-----\nTicket URL: $link\n$project.name <${project.url or abs_href()}>\n$project.descr\n
    9890notify_reporter_when_accepted.recipients = $ticket.reporter, trac-admin@hostname.com, trac_user
    9991notify_reporter_when_accepted.subject = '$ticket.summary' is now accepted
     
    245237[ticket-workflow-notifications]
    246238ticket_changed = *
    247 ticket_changed.body = Ticket changed by $change.author: $change.comment
    248                       {% for field in old_ticket %}{% if old_ticket[field] != ticket[field] %}
    249                       $field changed: ${old_ticket[field]} => ${ticket[field]}{% end %}{% end %}
     239ticket_changed.body = Ticket changed by $change.author: $change.comment\n\n{% for field in old_ticket %}{% if old_ticket[field] != ticket[field] %}\n$field changed: ${old_ticket[field]} => ${ticket[field]}{% end %}{% end %}
    250240ticket_changed.recipients = $ticket.reporter
    251241ticket_changed.subject = Ticket $ticket.id has changed!
    252242}}}
     243
     244=== Using Blank Lines in the Announcement Emails ===
     245
     246As the examples above show, you can add blank lines by typing "\n" in your email template.  The plugin's code will parse these "\n" strings into actual newline characters.  So, for example, a configuration like
     247
     248[{{
     249    notice.body = Notification for ticket $ticket.id: $link\n\n\n\nThis is a notification.
     250}}}
     251
     252should result in an email body with four blank lines between the two sentences.
     253
     254This seems to work more reliably than using the .ini file's own multi-line syntax which apparently collapses whitespace.
     255
     256Meanwhile, if there are any newlines whatsoever in your `.subject` configuration, the plugin will replace them with spaces.  This ensures that your email will have a valid subject (email subjects cannot contain newlines).
    253257
    254258== Recent Changes ==