What is the way to send sms using aws-sdk-js ? https://github.com/aws/aws-sdk-js
Is there is proper code available from amazon for this(javascript). I refered the below docs, but is not enough informative https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/SMS.html
This code actually worked for me.
const AWS = require('aws-sdk');
AWS.config.update({
region: 'ap-southwest-1',
accessKeyId: 'XXXXXXXXXXXXXXXXXXXX',
secretAccessKey: 'xxxxSSSSXXXXXXXXXXXXXXXXXXXXXXXXXX'
});
var sns = new AWS.SNS();
var params = {
Message: 'Alert! emssage.....',
MessageStructure: 'string',
PhoneNumber: 'XXXXXXXXXXXX'
};
sns.publish(params, function (err, data) {
if (err) console.log(err, err.stack);
else console.log(data);
});
Any better way of doing this with adding Sender ID and all?