diff --git a/notification/helper.py b/notification/helper.py index 1d7623b..79d8488 100644 --- a/notification/helper.py +++ b/notification/helper.py @@ -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) diff --git a/notification/notifier/twilio_sms.py b/notification/notifier/twilio_sms.py index 662c4ad..69fa82a 100644 --- a/notification/notifier/twilio_sms.py +++ b/notification/notifier/twilio_sms.py @@ -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'