diff --git a/app/clients/sms/aws_pinpoint.py b/app/clients/sms/aws_pinpoint.py index ce937d2a78..918e0b5937 100644 --- a/app/clients/sms/aws_pinpoint.py +++ b/app/clients/sms/aws_pinpoint.py @@ -12,7 +12,8 @@ class AwsPinpointClient(SmsClient): def init_app(self, current_app, statsd_client, *args, **kwargs): self._client = boto3.client('pinpoint-sms-voice-v2', region_name="ca-central-1") - super(SmsClient, self).__init__(*args, **kwargs) + super(AwsPinpointClient, self).__init__(*args, **kwargs) + # super(SmsClient, self).__init__(*args, **kwargs) self.current_app = current_app self.name = 'pinpoint' self.statsd_client = statsd_client @@ -41,10 +42,6 @@ def send_sms(self, to, content, reference, multi=True, sender=None): MessageType=messageType, ) - # this will be true if the OriginationIdentity does not exist in pinpoint - if response['MessageResponse']['Result'][destinationNumber]['StatusCode'] == 400: - self.statsd_client.incr("clients.pinpoint.error") - raise Exception(response['MessageResponse']['Result'][destinationNumber]['StatusMessage']) except ClientError as e: self.statsd_client.incr("clients.pinpoint.error") raise Exception(e) @@ -57,9 +54,9 @@ def send_sms(self, to, content, reference, multi=True, sender=None): self.statsd_client.timing("clients.pinpoint.request-time", elapsed_time) self.statsd_client.incr("clients.pinpoint.success") - return response['MessageResponse']['Result'][destinationNumber]['MessageId'] + return response['MessageId'] if not matched: self.statsd_client.incr("clients.pinpoint.error") self.current_app.logger.error("No valid numbers found in {}".format(to)) - raise ValueError("No valid numbers found for SMS delivery") \ No newline at end of file + raise ValueError("No valid numbers found for SMS delivery") diff --git a/app/delivery/send_to_providers.py b/app/delivery/send_to_providers.py index f5f94c571b..76b72d10fb 100644 --- a/app/delivery/send_to_providers.py +++ b/app/delivery/send_to_providers.py @@ -69,8 +69,6 @@ def send_sms_to_provider(notification): notification.international, notification.reply_to_text, ) - - template_dict = dao_get_template_by_id(notification.template_id, notification.template_version).__dict__