Created
September 27, 2016 16:52
-
-
Save negativo/152716565e4091eb9039f55f9781badd to your computer and use it in GitHub Desktop.
send sms with aws provider in NODEJS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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