Building a real-world Twilio application in ASP.NET Core

August 07, 2020
Written by
Reviewed by
Matt Makai
Twilion

Building a real-world Twilio application in ASP.NET Core and C#

As developers, we are well-used to taking a mix of code examples and trying to figure out how to actually implement these disjointed bits into a real world application.

In an effort to make this process easier, I created a detailed, real-world five-part video workshop!

I've used .NET Core to build the application in the workshop. .NET Core is an awesome framework and completely cross-platform, so whether you are on macOS, Windows or Linux, you can follow along with the code.

The workshop utilises Twilio products such as Twilio Studio, Twilio API for WhatsApp and Twilio SendGrid.

The workshop focusses (that's the British spelling for my American grammar checking friends!) on building out an ASP.NET Core 3.1 MVC application for The Cloud City Cake Co.. The Cloud City Cake Co. loves using tech to make the lives of its customers easier through technology.

What's covered

In video one, we cover Twilio Studio, a serverless way to create IVRs and chatbots. We integrate Studio with WhatsApp instant messaging to create an WhatsApp cake ordering service.

We go through how to use the Liquid Templating Language and handle HTTP requests. Along the way you'll learn a bunch of tips for getting the most out of Twilio Studio.

In video two, we create an ASP.NET Core 3.1 MVC application along with a webhook for Twilio to send cake order data to. We'll create a MSSQL database to store all of our data in too.

If you are unsure of how to use Microsoft SQL Server when not on Windows, then my blog covering SQL Server with Docker may be helpful.

In video three, we do a little bit of a code refactor, discussing good practices for better code maintainability. We also bring in a UI to manage our customer orders using Bootstrap.

In video four, we bring in Twilio SendGrid so we can send out emails to our customers. We cover how to add attachments to an email too.

In the fifth and final video we bring in the Twilio API for WhatsApp and create a notification service to manage customer communications.

Getting Started

You can sign up for the workshop here. It's completely free!

If you are new to Twilio and .NET, you may find the following blog posts helpful:

Or have a browse of all the awesome .NET content on the Twilio Blog.

happiness is a piece of cake written on a knife cutting cake

If you have any feedback on the workshop or you have content you would like to see in future workshops, then please feel free to reach out to me!