Skip to content

Commit

Permalink
Merge pull request #1792 from N-Mi/mail-notification-prefix
Browse files Browse the repository at this point in the history
new option to notify_by_email.py for adding a subject prefix
  • Loading branch information
olivierHa committed Jan 9, 2016
2 parents b0c5068 + bac4b7b commit 3ff5040
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions libexec/notify_by_email.py
Expand Up @@ -133,8 +133,8 @@ def create_mail(format):
msg['From'] = get_user()
logging.debug('To: %s' % (opts.receivers))
msg['To'] = opts.receivers
logging.debug('Subject: %s' % (get_mail_subject(opts.notification_object)))
msg['Subject'] = get_mail_subject(opts.notification_object)
logging.debug('Subject: %s' % (opts.prefix + get_mail_subject(opts.notification_object)))
msg['Subject'] = opts.prefix + get_mail_subject(opts.notification_object)

return msg

Expand Down Expand Up @@ -275,6 +275,8 @@ def create_html_message(msg):
choices=['host', 'service'], help='Choose between host or service notification.')
group_general.add_option('-S', '--SMTP', dest='smtp', default='localhost',
help='Target SMTP hostname. Default: localhost')
group_general.add_option('-p', '--prefix', dest='prefix', default='',
help='Mail subject prefix. Default is no prefix')

parser.add_option_group(group_debug)
parser.add_option_group(group_general)
Expand Down

0 comments on commit 3ff5040

Please sign in to comment.