You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I receive the sms it come in UTC when my appointment is set to Asia/Dubai.
I got it working using arrow convert method like this in tasks.py file:
@dramatiq.actor
def send_sms_reminder(appointment_id):
"""Send a reminder to a phone using Twilio SMS"""
# Get our appointment from the database
try:
appointment = Appointment.objects.get(pk=appointment_id)
except Appointment.DoesNotExist:
# The appointment we were trying to remind someone about
# has been deleted, so we don't need to do anything
return
> appointment_time = arrow.get(appointment.time)
> appointment_zone = appointment_time.to(appointment.time_zone)
> body = 'Hi {0}. You have an appointment coming up at {1}.'.format(
> appointment.name,
> appointment_zone.format('h:mm a')
> )
client.messages.create(
body=body,
to=appointment.phone_number,
from_=settings.TWILIO_NUMBER,
)
The text was updated successfully, but these errors were encountered:
Hi
When I receive the sms it come in UTC when my appointment is set to Asia/Dubai.
I got it working using arrow convert method like this in tasks.py file:
The text was updated successfully, but these errors were encountered: