How to set a sender while sending sms from AWS SNS service?
Checking the docs for SNS about sending SMS https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/sns-examples-sending-sms.html#sending-sms-getattributes
And also here https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/SNS.html#publish-property
With these docs combined I can send a sms but the sender remains unset. Why?
var AWS = require('aws-sdk');
AWS.config.update({ region: 'eu-west-1' });
var params = {
Message: 'TEXT_MESSAGE',
PhoneNumber: '+44123456780',
MessageAttributes: {
'SenderID': {
DataType: "String",
StringValue: "Company1",
}
}
};
var publishTextPromise = new AWS.SNS().publish(params).promise();
publishTextPromise.then(
function (data) {
console.log("MessageID is " + data.MessageId);
}).catch(
function (err) {
console.error(err, err.stack);
});
I can send a sms except I cannot see a way to set a sender. How do I set a sender for each message?