Skip to content
This repository has been archived by the owner on Jun 7, 2023. It is now read-only.

Demo application showing how to implement SMS notifications (for a mobile marketing use case) in ASP.NET MVC

License

Notifications You must be signed in to change notification settings

TwilioDevEd/marketing-notifications-csharp

Repository files navigation

Twilio

SMS Notifications with Twilio and ASP.NET MVC

With the amount of noise in social media and e-mail inboxes, it's hard to make a meaningful connection with your customers or audience. SMS text and/or MMS picture messages, however, are a personal communication channel with an open rate above 95%, which make them a great choice for social communication.

In this tutorial, you will learn how to enable your users to opt-in for an SMS marketing campaign using their mobile phone.

Read the full tutorial here!

Local Development

  1. First clone this repository and cd into it.

    git clone git@github.com:TwilioDevEd/marketing-notifications-csharp.git
    cd marketing-notifications-csharp
  2. Rename the file MarketingNotifications.Web/Local.config.example to MarketingNotifications.Web/Local.config and update the content.

    You can find your TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN in your Twilio Account Settings. You will also need a TWILIO_NUMBER, which you may find here.

  3. Build the solution.

  4. Run Update-Database at Package Manager Console to execute the migrations.

    Be sure to ckeck SQLServer 2019 (with LocalDB support) is up and running and the server name matches the one from the connection string on MarketingNotifications.web/Web.config.

  5. Run the application.

  6. Expose application to the wider internet. To start using ngrok on our project you'll have to execute the following line in the command prompt

    ngrok http 1086 -host-header="localhost:1086"

    Keep in mind that our endpoint is:

    http://<your-ngrok-subdomain>.ngrok.io/Subscribers/Register
    
  7. 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 the address provided by ngrok into the Messaging Request URL field.

  1. Wrap Up!

By now your application should be up and running at http://localhost:1086/. Now your subscribers will be able to text your new Twilio number to subscribe to your Marketing Notifications service.

To subscribe, just send any message to your configured Twilio phone number and it will reply with a text.

Meta

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

About

Demo application showing how to implement SMS notifications (for a mobile marketing use case) in ASP.NET MVC

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages