Skip to content

Instantly share code, notes, and snippets.

@negativo
Created September 27, 2016 16:52
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save negativo/152716565e4091eb9039f55f9781badd to your computer and use it in GitHub Desktop.
Save negativo/152716565e4091eb9039f55f9781badd 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
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment