Build the future of communications.
Start Building for Free

ASP.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 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 Similoluwa Adegoke
    How to build an Email Newsletter application using ASP.NET Core and SendGrid How to build an Email Newsletter using ASP.NET Core and SendGrid

    Sending out newsletters is a great way to keep your audience up-to-date on the latest news. There are existing newsletter products like SendGrid Email Marketing, however, in a scenario where the client demands more customization, building a newsletter app yourself using the SendGrid Email API is a great alternative.

    The advantage of building your own newsletter application is that you can control the nuts and bolts of the system and still maximize deliverability and measure engagement with SendGrid.

    In this tutorial, you will learn how to build a newsletter app using ASP.NET Core Razor Pages and SendGrid.

    Solution Overview

    Every newsletter application involves two parties: the subscriber of the newsletter, and the author of the newsletter.

    The subscriber's journey goes like this: The soon-to-be subscriber fills out a form to subscribe that includes their email address and other details (depending on your business needs). When the subscriber submits the …

    Read More
  • By Maarten Balliauw
    How to test ASP.NET Core Minimal APIs How to test  ASP.NET Core Minimal APIs

    How do you test that your ASP.NET Core Minimal API behaves as expected? Do you need to deploy your application? Can you write tests with frameworks like xUnit, NUnit, or MSTest?

    In this post, you will learn the basics of testing ASP.NET Core Minimal APIs. You’ll get started with testing a “hello world” endpoint, and then test a more complex API that returns JSON data. You’ll finish with customizing the ASP.NET Core service collection, so you can customize services for your unit tests and integration tests.

    By the end of this post, you will have a good understanding of how to make sure your ASP.NET Core Minimal APIs behave as expected and can be deployed to production, even on Fridays!

    Prerequisites

    Read More
  • By Niels Swimberghe
    How to better configure C# and .NET applications for Twilio How to better configure C# and .NET apps for Twilio

    There are a hundred different ways to provide configuration to your applications. For almost any programming language, you can use environment variables and .env files, but configuration can also be stored in other file formats like JSON, YAML, TOML, XML, INI, and the list keeps on going. Though, in some scenarios configuration isn't pulled from files, but instead is pulled from a service like Azure Key Vault, HashiCorp Vault, or a similar vault service. It is rare that your configuration will come from a single source. Luckily, there are APIs in .NET that can help you grab configuration from multiple sources and merge them together.

    In this tutorial, you'll start with an application that sends text messages using Twilio Programmable SMS, where the configuration is fetched directly from the environment variables. You'll then refactor the app to

    • fetch configuration from multiple sources, specifically, JSON files, user-secrets, environment variables, and …
    Read More
  • By Niels Swimberghe
    What's new in the Twilio helper library for ASP.NET (v5.73.0 - April 2022) What's new in the Twilio helper library for ASP.NET (v5.73.0 - April 2022)

    The Twilio helper library for ASP.NET (Twilio.AspNet) is a community-driven open-source project to make integrating Twilio with ASP.NET easier, for both ASP.NET Core and ASP.NET MVC on .NET Framework. The library helps you with very common use cases like:

    • Responding to Twilio webhook requests with TwiML objects from the official Twilio SDK for C# and .NET.
    • Binding data from Twilio webhook requests to strongly typed .NET objects.
    • Validating webhook requests originate from Twilio and rejecting them if not.

    As .NET and ASP.NET is evolving, the Twilio.AspNet contributors are enhancing the library to take advantage of the newest capabilities and best practices. So what's new?

    What's old in Twilio.AspNet

    Actually, before I share the shiny new additions, let me share what is already part of the library. After all, this is the first blog post to share news about the library.

    Handle Twilio webhook requests with ASP.NET

    In previous versions …

    Read More
  • By Néstor Campos
    Organize Incoming Email Attachments with C# and ASP.NET Core using Twilio SendGrid Inbound Parse Organize Incoming Email Attachments with C# and ASP.NET Core using Twilio SendGrid Inbound Parse

    At times, people in many organizations must organize and associate files (such as accounts, invoices, and more) with each employee or vendor in the company. Generally, these files arrive by email to a default mailbox that is constantly monitored, but manually. In this post, you are going to learn how to organize and associate files that users send by email to a particular mailbox through Twilio SendGrid with an API built in ASP.NET.

    Prerequisites

    To complete this tutorial, you will need a free Twilio SendGrid account and experience working with ASP.NET applications using the C# language. Sign up here to send up to 100 emails per day completely free of charge.

    Additionally, the API that you are going to create needs to be publicly exposed to be accessed from Twilio SendGrid, in this tutorial you will use ngrok to test your application without the need to deploy it in …

    Read More
  • By Niels Swimberghe
    How to prevent email HTML injection in C# and .NET How to prevent email HTML injection in C# and .NET

    Every few years, the Open Web Application Security Project (OWASP) publishes a new list of the 10 most common security issues in web applications, called OWASP Top 10. There is one security flaw that has been around since the first edition in 2003, and grabbed the first spot in the 2010, 2013, and 2017 editions, and that security issue is vulnerability to injection attacks. I previously talked about injection attacks in general and more specifically, how dangerous email HTML injection attacks are and how you can prevent them. However, in this post, you'll learn how you can mitigate HTML injection attacks in .NET specifically.

    How HTML injection into emails work

    HTML injection is a vulnerability where an application accepts user input and then embeds the input into HTML. A malicious user can inject HTML through the user input so that their malicious HTML is embedded into …

    Read More
  • By Niels Swimberghe
    How to send ASP.NET Core Identity emails with Twilio SendGrid Send ASP.NET Core Identity emails with Twilio SendGrid

    As part of ASP.NET Identity, ASP.NET Core provides a bunch of features for account management, authentication, and authorization. ASP.NET Identity also sends emails to confirm email addresses and reset passwords, but it's up to you to implement how those emails are sent.

    In this tutorial, you will learn how to send ASP.NET Identity emails using Twilio SendGrid.

    Prerequisites

    You will need these things to follow along:

    You can find the source code for this tutorial on GitHub. Use it if you run into any issues, or submit an issue, if you run into problems.

    Configure your SendGrid account …

    Read More
  • By Luís Leão
    Crear una aplicación de chat de video con ASP.NET Core 2.2, Angular y Twilio Crear una aplicación de chat de video con ASP.NET Core 2.2, Angular y Twilio

    La interacción con el usuario en tiempo real es una excelente manera de mejorar las capacidades de comunicación y colaboración de una aplicación web. El chat de video es una opción obvia para las ventas, la atención al cliente y los sitios educativos, pero ¿cómo se puede implementar con rapidez? El video programable Twilio le permite agregar de manera eficiente un chat de video sólido a sus aplicaciones, ya sea que esté utilizando un marco de trabajo de Modelo-Vista-Controlador de JavaScript, como Angular, o las plantillas del servidor.

    En esta publicación, se mostrará cómo crear una aplicación de chat de video mediante el SDK JavaScript de Twilio en su aplicación de una sola página Angular (SPA) y el SDK de Twilio para C# y .NET en su código de servidor de ASP.NET Core. Creará las interacciones necesarias para crear y unirse a salas de chat de video, y para publicar …

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