是否可以在AWS sns sms webhook中发送额外的信息?

时间:2020-04-22 11:40:24

标签: node.js amazon-web-services amazon-sns

我想在SMS事件中传递一个信息,当我使用该信息获得该事件时,我可以简单地将值存储在该特定ID文档中。谁能告诉我如何在SMS网络挂钩中传递额外的信息?

require("dotenv").config();
const aws = require('aws-sdk');
 aws.config = new aws.Config();
 aws.config.accessKeyId = process.env.AWS_ACCESS_KEY_ID;
 aws.config.secretAccessKey = process.env.AWS_SECRET_KEY;
 aws.config.region = "us-east-1";
var sns = new aws.SNS();

function sendSMS(to_number, message, cb) {
  sns.publish(
    { 
      Message: message,
      Subject: "Owner Campaign",
      PhoneNumber: to_number,
    MessageAttributes:{
      'SenderID': {
          DataType: "String",
          StringValue: "GF-NOTICE",
      }
  }
},
    cb
  );
}

const PhoneNumberArray = ["+91223555655"];
PhoneNumberArray.forEach((number) => {
  sendSMS(
    number,
    "Lorem Ipsum is simply dummy text of the printing and typesetting industry.",
    (err, result) => {
      console.log("RESULTS: ", err, result);
    }
  );
});

我想在SMS网络挂钩中传递广告系列,我将像这样添加广告系列:'abcded'

0 个答案:

没有答案