这是indexloc提供的服务,不要输入任何密码
Skip to content
This repository was archived by the owner on Feb 8, 2019. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion notification/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def generate_notifications_for_incident(incident):
notification.notifier = method.method
notification.send_at = notify_at
uri = settings.BASE_URL + "/incidents/details/" + str(incident.id)
notification.message = "A Service is experiencing a problem: " + incident.incident_key + " " + incident.description + ". Handle at: " + uri
notification.message = "A Service is experiencing a problem: " + incident.incident_key + " " + incident.description + ". Handle at: " + uri + " Details: " + incident.details

notifications.append(notification)

Expand Down
4 changes: 3 additions & 1 deletion notification/notifier/twilio_sms.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@ def __init__(self, config):
self.__config = config

def notify(self, notification):
max_length = 140
message = (notification.message[:max_length-2] + '..') if len(notification.message) > max_length else notification.message
client = TwilioRestClient(self.__config['SID'], self.__config['token'])
try:
client.sms.messages.create(body=notification.message,
client.sms.messages.create(body=message,
to=notification.user_to_notify.profile.phone_number,
from_=self.__config['sms_number'])
print 'successfully sent the sms'
Expand Down