Skip to content
Snippets Groups Projects
Commit cc4013f0 authored by Valentin Groues's avatar Valentin Groues :eyes:
Browse files

add logging for sms sending

parent 9f85c83a
No related branches found
No related tags found
No related merge requests found
Pipeline #
import logging
import nexmo import nexmo
from django.conf import settings from django.conf import settings
logger = logging.getLogger(__name__)
class Nexmo: class Nexmo:
""" """
...@@ -28,4 +32,5 @@ class Nexmo: ...@@ -28,4 +32,5 @@ class Nexmo:
def send_sms(self, device, token): def send_sms(self, device, token):
body = 'Your authentication token is %s' % token body = 'Your authentication token is %s' % token
phone_number = device.number.as_e164 phone_number = device.number.as_e164
logger.info("Sending authentication token to %s", phone_number)
self.client.send_message({'to': phone_number, 'from': self.default_from, 'text': body}) self.client.send_message({'to': phone_number, 'from': self.default_from, 'text': body})
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment