I am part of a team building a proprietary Learning Management System for our organization. When a user is enrolled into an online course, we are sending an email to the user with instructions on logging in to take their course. When enrolling users en masse, obviously this is causing some performance issues. I am looking into developing a framework for queuing emails and then sending them asynchronously.
Our platform is deployed via an Azure web app and Azure SQL database. It is written in .NET MVC and we are sending emails via SMTP.
Does anyone have any recommendations on best practice or what would be the most effective way to accomplish this? I've looked into Azure Service Bus, third-party open source solutions (such as Hangfire), and writing a standard console application that processes a database table of the emails to be sent.
You are on the right path. Azure Service Bus and Azure Functions will suit your needs. The flow will be:
Azure Service Bus bindings for Azure Functions
Get started with Service Bus queues
If you decide to use Hangfire, it would be optimal to use the Hangfire.Azure.ServiceBusQueue package.