Coder Social home page Coder Social logo

krispi1 / marketing-notifications-node Goto Github PK

View Code? Open in Web Editor NEW

This project forked from twiliodeved/marketing-notifications-node

0.0 0.0 0.0 1.34 MB

Demo application showing how to implement SMS notifications (for a mobile marketing use case) in Node.js

Home Page: https://www.twilio.com/docs/tutorials/walkthrough/marketing-notifications/node/express

License: MIT License

JavaScript 29.42% HTML 69.91% CSS 0.66%

marketing-notifications-node's Introduction

Twilio

SMS Notifications for Node.js and Express

Build Status

This example project demonstrates how to send SMS notifications (for a mobile marketing campaign) using Node.js and Express.

Read the full tutorial here!

Running the Project in production

1. Deploy your App

2. Configure your Twilio number

Go to your dashboard on Twilio. Click on Twilio Numbers and choose a number to setup.

On the phone number page, enter https://<appname.com>/message into the Messaging Request URL field.

Request URL

3. Wrap Up!

Now your subscribers will be able to text your new Twilio number to 'Subscribe' to your Marketing Notifications line.

Congratulations!

Running the Project on Your Machine

To run this project on your computer, download or clone the source. You will also need to download and install:

Finally you will also need to sign up for a Twilio account if you don't have one already.

1. Install Dependencies

Navigate to the project directory in your terminal

npm install

This should install all of our project dependencies from npm into a local node_modules folder.

2. Configuration

Next, open config.js at the root of the project and update it with values from your environment and your Twilio account. You can either export these values as system environment variables (this is the default setup), or you can replace these values with hard-coded strings (be careful you don't commit them to git!).

This sample application stores data in a MongoDB database using Mongoose.

You can download and run MongoDB yourself

Our application will be looking for a fully qualified MongoDB connection string with a username and password embedded in it.

3. Running the Project

To launch the application, you can use node . in the project's root directory. You might also consider using nodemon for this. It works just like the node command, but automatically restarts your application when you change any source code files.

npm install -g nodemon \
nodemon .

4. Exposing Webhooks to Twilio

You will likely need to expose your local Node.js web application on the public Internet to work with Twilio. We recommend using ngrok to accomplish this. Use ngrok to expose a local port and get a publicly accessible URL you can use to accept incoming calls or texts to your Twilio numbers.

The following example would expose your local Node application running on port 3000 at http://chunky-danger-monkey.ngrok.com (reserved subdomains are a paid feature of ngrok):

ngrok -subdomain=chunky-danger-monkey 3000

License

MIT

Meta

  • No warranty expressed or implied. Software is as is. Diggity.
  • MIT License
  • Lovingly crafted by Twilio Developer Education.

marketing-notifications-node's People

Contributors

kwhinnery avatar hortega avatar nebtrx avatar well1791 avatar jarodreyes avatar joliveros avatar kathyguerron avatar smendes avatar juancarlospaco 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.