Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new option to notify_by_email.py for adding a subject prefix #1792

Merged
merged 1 commit into from Jan 9, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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