import requests
from django.conf import settings

def send_otp_to_phone(mobile, otp):
    try:
        message = otp + " is your One Time Password(OTP) For Signup. Thank You 18STORES"
        url = settings.SMS_HOST + 'username='+str(settings.SMS_USERNAME)+'&password='+str(settings.SMS_PASSWORD)+'&from='+str(settings.SMS_FROM)+'&to='+str(mobile)+'&msg='+str(message)+'&type=1&dnd_check=0&template_id='+str(settings.OTP_TEMPLATE)
        response = requests.get(url)
        return True
    except Exception as e:
        print(e)
        return False
