To send emails using Azure Communication Services, you can use the BlazorEmailRenderer along with your Azure Communication Services email client. Here’s an example of rendering and sending an email:

Example

var emailRenderer = new BlazorEmailRenderer(serviceProvider);
var emailHtml = await emailRenderer.RenderEmail<EmailTemplate>(emailParams =>
    emailParams.Add(x => x.EmailTitle, "Your Subject Here"));

// Send the rendered email using Azure Communication Services
var emailClient = new EmailClient("<connection_string>");
await emailClient.SendAsync(new EmailMessage(
    sender: "your-email@example.com",
    recipients: new List<string> { "recipient@example.com" },
    subject: "Your Subject Here",
    htmlContent: emailHtml
));