TL;DR Wan't to specify transactional/promotional message type on the fly (as a param) without having to set the message attributes every time.
So I want to send OTPs to customer using amazon SNS and this is the code for the following:
import boto3
client = boto3.client('sns')
response = client.publish(
PhoneNumber='some_phone_number',
Message='some_message'
)
According to their documentation, there are 2 message types:
1. Transactional (Time critical delivery)
2. Promotional (Non time critical delivery and cost effective)
I have an option to set the default message attributes using the set_sms_attributes() as follows:
client.set_sms_attributes(
attributes={"DefaultSMSType": "Transactional" | "Promotional" }
)
I donot wan't to keep changing this param as they are defaults. I wan't to be able to specify the message type on the fly as a parameter in publish()
I checked out the MessageAttributes but according to their docs, it's not to specify the message type but contains metadata for the client to handle the message before processing it.
Is there a way to toggle the message type on the fly without having to set it in the default settings using the set_sms_attributes ?