mirror of
https://github.com/ansible/awx.git
synced 2026-05-18 06:47:41 -02:30
Refactor message generator
* Job object can now control the output and generate K:V output for notification types that can support it * Notifications store the body as json/dict now to encode more information * Notification Type can further compose the message based on what is sensible for the notification type * This will also allow customizing the message template in the future * All notification types use sane defaults for the level of detail now
This commit is contained in:
@@ -18,3 +18,10 @@ class CustomEmailBackend(EmailBackend):
|
||||
recipient_parameter = "recipients"
|
||||
sender_parameter = "sender"
|
||||
|
||||
def format_body(self, body):
|
||||
body_actual = "{} #{} had status {} on Ansible Tower, view details at {}\n\n".format(body['friendly_name'],
|
||||
body['id'],
|
||||
body['status'],
|
||||
body['url'])
|
||||
body_actual += pprint.pformat(body, indent=4)
|
||||
return body_actual
|
||||
|
||||
Reference in New Issue
Block a user