update sms api for smspipe
Build and Push Docker Images / Build and Push Docker Images (push) Failing after 9s
Build and Push Docker Images / Build and Push Docker Images (push) Failing after 9s
This commit is contained in:
@@ -232,14 +232,15 @@ def send_sms_with_callback_token(user, mobile_token, **kwargs):
|
||||
logger.debug("Failed to send SMS. Missing SMS_API_URL or SMS_API_KEY.")
|
||||
return False
|
||||
|
||||
from api.notifications import format_mobile
|
||||
|
||||
headers = {
|
||||
"Content-Type": "application/json",
|
||||
"Authorization": f"Bearer {api_key}",
|
||||
"X-API-Key": api_key,
|
||||
}
|
||||
data = {
|
||||
"number": to_number,
|
||||
"message": base_string % mobile_token.key,
|
||||
"check_delivery": False,
|
||||
"to": format_mobile(to_number),
|
||||
"text": base_string % mobile_token.key,
|
||||
}
|
||||
print(mobile_token.key)
|
||||
response = requests.post(api_url, headers=headers, data=json.dumps(data))
|
||||
|
||||
Reference in New Issue
Block a user