Create Send SMS Model
We are going to be following the typical MVC pattern, so we'll start with the 'M' which stands for Model. In Visual Studio add a new file to the Models folder called SmsModel.cs. Insert a using statement for System.ComponentModel.DataAnnotations at the top of this file and add the following code to it:
[Required(ErrorMessage = "To Number Required", AllowEmptyStrings = false)]
[Phone]
[Display(Name = "To Number")]
public string To { get; set; }
[Required(ErrorMessage = "From Number Required", AllowEmptyStrings = false)]
[Phone]
[Display(Name = "From Number")]
public string From { get; set; }
[Required(ErrorMessage = "Message Text Required", AllowEmptyStrings = false)]
[Display(Name = "Message Text")]
public string Text { get; set; }
How to Receive SMS Delivery Receipts with ASP.NET Core MVC
Delivery receipts allow you to get information about when an SMS is delivered to a user's handset. This tutorial shows how you can receive these delivery receipt notifications in your ASP .NET application.
Steps
1
Introduction to this tutorial2
Prerequisites3
Create the SMS Project File4
Add Vonage Dotnet SDK5
Create Send SMS Model6
Create a Send SMS View7
Set up Startup Route8
Add an SMS Controller9
Add Delivery Receipt Route to Controller10
Configure the ASP.NET App11
Run the .NET App12
Conclusion