The SendWelcomeEmail Azure Function is triggered when a new message is added to an Azure Queue. 

 

 

Trigger: The function is triggered by a new message in the Azure Queue named new-users. The message that triggers the function will typically contain the user's email address.
Event: When a new user is added to the queue (with their email address), the function is triggered, and it sends a welcome email to that user.

 

 

Azure Queue
Normally we add the user's email to the queue On User Registration (in an API or Web App), When a user signs up on your website or mobile app

 

 

Adding a Message to the Azure Queue
Add a message to the queue (e.g., from a web API, user registration process, or a background task) 

CloudQueueClient queueClient = cloudStorageAccount.CreateCloudQueueClient();


CloudQueue queue = queueClient.GetQueueReference("new-users");
await queue.CreateIfNotExistsAsync();

CloudQueueMessage message = new CloudQueueMessage("deepak@domain.com");
await queue.AddMessageAsync(message);

 


Related Question