Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save kevinold/368387f8da42ce7d24179f3a14359051 to your computer and use it in GitHub Desktop.
Save kevinold/368387f8da42ce7d24179f3a14359051 to your computer and use it in GitHub Desktop.
send sms with aws provider in NODEJS
var AWS = require('aws-sdk');
AWS.config.region = 'your aws region';
AWS.config.update({
accessKeyId: "your access id",
secretAccessKey: "your secret access key",
});
var sns = new AWS.SNS();
var params = {
Message: "your message"
MessageStructure: 'string',
PhoneNumber: 'phone_number_without_+',
Subject: 'your subject'
};
sns.publish(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
@jonascasarin
Copy link

Tavo962, you need to use at end of 11 line a ",". It's a JSON pattern :).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment