dockerise for push
This commit is contained in:
+35
-1
@@ -13,4 +13,38 @@ sms_api = Ghasedak(api_key=os.getenv("SMS_API_KEY"))
|
||||
|
||||
### ارسال پیام otp
|
||||
|
||||
#response = sms_api.send_otp_sms(receptor='09359****', message='OTP message')
|
||||
#response = sms_api.send_otp_sms(receptor='09359****', message='OTP message')
|
||||
|
||||
|
||||
|
||||
import ghasedak_sms
|
||||
|
||||
# Initialize the Ghasedak API client with your API key
|
||||
sms_api = ghasedak_sms.Ghasedak(api_key="Your_API_KEY")
|
||||
|
||||
# Define the OTP code and the recipient's phone number
|
||||
otp_code = "123456" # Replace with the generated OTP code
|
||||
phone_number = "09xxxxxxxxx" # Replace with the recipient's phone number
|
||||
|
||||
# Create the OTP input object
|
||||
otp_input = ghasedak_sms.SendOtpInput(
|
||||
send_date=None, # Immediate send; use a specific datetime for scheduled send
|
||||
receptors=[
|
||||
ghasedak_sms.SendOtpReceptorDto(
|
||||
mobile=phone_number,
|
||||
# client_reference_id='optional_client_ref_id' # Optional: Add if you have a client reference ID
|
||||
)
|
||||
],
|
||||
template_name="YourTemplateName", # Replace with your OTP template name
|
||||
inputs=[
|
||||
ghasedak_sms.SendOtpInput.OtpInput(param="Code", value=otp_code),
|
||||
# Add more parameters if your template requires them
|
||||
],
|
||||
udh=False # Set to True if you need User Data Header; typically False for standard SMS
|
||||
)
|
||||
|
||||
# Send the OTP SMS
|
||||
response = sms_api.send_otp_sms(otp_input)
|
||||
|
||||
# Print the response to check the result
|
||||
print(response)
|
||||
Reference in New Issue
Block a user