Build the future of communications.
Start Building for Free

.NET posts

  • By Niels Swimberghe
    Use Visual Studio Port Tunneling to handle Twilio Webhooks Use Visual Studio Port Tunneling to handle Twilio Webhooks

    Visual Studio recently introduced a new feature called port tunneling. By using port tunneling, Visual Studio will create a new public URL (tunnel URL) for you, and HTTP requests sent to the tunnel URL will be forwarded to your ASP.NET Core project running on localhost.

    Port tunneling has a lot of use cases. You could use this to easily test your web application on other devices like mobiles phone and tablets. You could also use this to make your application temporarily, publicly available for doing interactive demos and inviting your audience to participate.

    How to use port tunneling with Twilio

    The most exciting use case for Twilio is that you can use port tunneling to test webhooks. What are webhooks again?

    "Webhooks are user-defined HTTP callbacks. They are triggered by some event in a web application and can facilitate integrating different applications or third-party APIs, like Twilio." …

    Read More
  • By Néstor Campos
    How to send a vCard with MMS using C# and .NET Send vCards via MMS using C# and .NET

    You can use the Twilio Programmable Messaging to send contact information in vCard format via MMS. If you have a business with many users and you must send contact information, you should consider sending it over MMS. You can also send vCards via WhatsApp, but using MMS will allow you to reach anyone even if they don't use WhatsApp. In this post, you will see how to generate and send vCards over MMS programmatically using C# .NET.

    Prerequisites

    You will need the following for your development environment:

    You can find the source code of this tutorial in this GitHub repository.

    What is vCard?

    vCard …

    Read More
  • By Volkan Paksoy
    How to send RSS feed digest email with C# and SendGrid Dynamic Email Templates How to send RSS feed digest email with C# and SendGrid Dynamic Email Templates

    In this article, you will learn how to create a nicely formatted dynamic email using the Twilio Blog RSS feed as source data and send it via the SendGrid API. You will first look into creating the template with test data. Then you will learn how to parse RSS and HTML and send the emails with dynamic data.

    Prerequisites

    You'll need the following things for this tutorial:

    Read More
  • By Niels Swimberghe
    How to Bulk Email with C# and .NET: Zero to Hero How to Bulk Email with C# and .NET

    In a previous tutorial, I shared how you can send individual emails using the SendGrid API. This use case is perfect for transactional emails where you send an email to a single recipient or a small number of recipients. But what if you need to send emails to a very large audience? Well, in this tutorial you'll learn how to send bulk emails using the SendGrid API and C# .NET.

    If you're not familiar with sending transactional emails using .NET, I advise you go through the previous post about sending emails with C# and SendGrid first.

    Prerequisites

    Here’s what you will need to follow along:

    Read More
  • By Néstor Campos
    How to send vCards with WhatsApp using C# and .NET Send vCards with WhatsApp and C#

    You can use the Twilio Programmable Messaging to send contact information in vCard format via WhatsApp. If you use WhatsApp regularly, on some occasions you may have had to send or receive the contact info of a person to whom you must text or call. In this post, you will see how to do this programmatically.

    Prerequisites

    You will need the following for your development environment:

    You can find the source code of this tutorial in this GitHub repository.

    What is vCard?

    vCard is a standard format for sharing contact information between people and applications. This information may include personal information, phone numbers, email addresses, …

    Read More
  • By Similoluwa Adegoke
    Send Recurring Emails using C# .NET and Hangfire with SendGrid Send Recurring Emails using C# and Hangfire

    Sometimes you need to send out emails at a certain interval - monthly, weekly, daily, or even more frequent. To run jobs on a time interval, you can use operating system tools like cron jobs on Linux or the task scheduler on Windows. Alternatively, you can create your own long running application that schedules the jobs for you. However, developing a robust job scheduler is not an easy task. Luckily, there are some great libraries that take care of this for you like Hangfire.

    In this tutorial you will learn how to send recurring emails using Hangfire and the SendGrid Email API.

    Check out this article to learn how to send recurring emails using Quartz.NET, which is another scheduling system for .NET.

    Prerequisites

    You will need a few things to follow along:

    • A Twilio SendGrid Account. Sign up here to send up to 100 emails per day …
    Read More
  • By Dave Glick
    Render Emails Using Razor Templating Render Emails Using Razor Templating

    In the previous post, you went inside the Razor engine to learn how it works and understand what goes on when you turn a Razor file into HTML. You examined the four phases of parsing, code generation, compilation, and execution and how your C# code ends up being mixed together with your raw markup and output content. In this post, you’ll take things a step further and put that knowledge to use by comparing some open-source implementations of the Razor engine. You'll also learn how to use these Razor engines in your applications and render email templates to send emails with a service like SendGrid.

    The Different Kinds Of Razor Implementations

    Recall from the previous post that when you talk about Razor as a templating language, and even as an engine, you’re really talking about two different things: the underlying low-level Razor engine that’s responsible for the four execution …

    Read More
  • By Dave Glick
    What is Razor Templating, really? What is Razor Templating, really?

    Many .NET developers are familiar with Razor syntax. It's found in ASP.NET Core views (.cshtml), Razor pages, Razor component files (.razor), Blazor, Razor class libraries, and more. In general, Razor provides features for evaluating .NET code such as C# inside HTML. Despite being deceptively simple with only a handful of syntax primitives, there's a lot going on behind the scenes to make everything work correctly. In this post, you'll explore the fundamentals of the Razor engine. Then you’ll learn how it processes your Razor syntax to produce .NET assemblies and runs those assemblies to create content. Then in a follow-up post, once you've got a good handle on the Razor engine, you'll look at some open-source tools that leverage the Razor engine in various ways beyond what ships in .NET Core and how you can leverage these libraries to create Razor templates …

    Read More
  • By Niels Swimberghe
    Find your U.S. Representatives and Congressional Districts with SMS and ASP.NET Core Find your Representatives & Congressional Districts with SMS and ASP.NET Core

    When someone runs for office in the United States of America (U.S.), they have to fulfill certain "Ballot Access Requirements" to become listed on the ballot. One of those requirements could be that you need a certain number of signatures per district. So when volunteers and campaign workers go out to gather signatures, it is instrumental to know which congressional district (CD) the signee belongs to. However, knowing which congressional district you are from is not common knowledge, especially in areas where the district cuts right through counties, cities, and neighborhoods.

    States redraw their congressional districts every decade after getting an updated population count from the Census Bureau. Each district is represented by a single U.S. representative in the U.S. House of Representatives. However, the manner in which these districts are drawn often result in unique and odd shapes which can be confusing. This is why constituents living just a …

    Read More
  • By Volkan Paksoy
    Send Emails with C#, Handlebars templating, and Dynamic Email Templates Send Emails with C#, Handlebars templating, and Dynamic Email Templates

    Email communication is an essential aspect of most businesses. In this post, you will look into the basics of sending emails with the Twilio SendGrid Email API and sending templated emails with the Handlebars templating language. Finally, you will finish by putting it together in a sample project that sends emails based on a template.

    Prerequisites

    You'll need the following things for this tutorial:

    Set Up SendGrid

    API Key

    First things first: To use the SendGrid API, you need an API key. Create one by heading over to the …

    Read More
  • Newer
    Older
    Sign up and start building
    Not ready yet? Talk to an expert.