mirror of
https://github.com/ansible/awx.git
synced 2026-05-12 03:47:36 -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:
@@ -5,11 +5,11 @@ import logging
|
||||
|
||||
import requests
|
||||
|
||||
from django.core.mail.backends.base import BaseEmailBackend
|
||||
from awx.main.notifications.base import TowerBaseEmailBackend
|
||||
|
||||
logger = logging.getLogger('awx.main.notifications.hipchat_backend')
|
||||
|
||||
class HipChatBackend(BaseEmailBackend):
|
||||
class HipChatBackend(TowerBaseEmailBackend):
|
||||
|
||||
init_parameters = {"token": {"label": "Token", "type": "password"},
|
||||
"channels": {"label": "Destination Channels", "type": "list"},
|
||||
@@ -35,7 +35,7 @@ class HipChatBackend(BaseEmailBackend):
|
||||
r = requests.post("{}/v2/room/{}/notification".format(self.api_url, rcp),
|
||||
params={"auth_token": self.token},
|
||||
json={"color": self.color,
|
||||
"message": m.body,
|
||||
"message": m.subject,
|
||||
"notify": self.notify,
|
||||
"from": m.from_email,
|
||||
"message_format": "text"})
|
||||
|
||||
Reference in New Issue
Block a user