Giter Site home page Giter Site logo

sms's Introduction

步骤1

现在阿里云通信中的短信签名中申请签名,签名在你短信中是以: 【短信签名】你短信模板内容 方式为主的。

步骤2

申请短信模板,短信模板的变量是以这种形式存在的:${name},可以写多个: 示例:尊敬的${name},您的快递已在飞奔的路上,将在今天${time}送达您的手里,请留意查收。

步骤3

申请accesskeys,在你控制台上面有个accesskeys,点击申请就能显示你的id及Secret。

步骤4

在demo文件夹中的index.js中填写你的accessKeyId和secretAccessKey,就是你在步骤3申请的id和secret。

步骤5

在sendSMS中填写 1、PhoneNumbers // 发送短信的账号,可以多写,用逗号分隔 2、SignName // 你步骤一申请的签名 3、TemplateCode // 你步骤2申请的模板code码 4、TemplateParam // 你步骤2中短信模板的变量名称要表达的含义

步骤6

定时执行任务node-schedule

      function scheduleCronstyle(){
        //秒 、 分 、时 、 日 、 月 、 年 
            schedule.scheduleJob('30 0 7 * * *', function(){
                console.log('scheduleCronstyle:' + new Date());
            }); 
        }
    scheduleCronstyle();

6个*分别代表了秒 、 分 、时 、 日 、 月 、 年 ,如上每天7点0分30秒的时候

步骤7

服务器上面pm2守护对应的nodejs进程即可。

ps: 阿里云短信这个一进来会送10元的代金券,可以用很久了。 祝各位能哄得女朋友开心

sms's People

Contributors

chinalijinglun avatar

Watchers

James Cloos avatar Anothermoon avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.