BW.Framework uses EmailGroup objects to manage email recipients and sending.
| Group | Description | Usage |
|---|---|---|
EmailGroup.SysAdmin |
System administrators | Critical alerts, startup failures |
// Create an email group
var emailGroup = new EmailGroup();
// Set the recipient
emailGroup.ToAddress = new EmailAddress("John Doe", "john@example.com");
// Send the email
emailGroup.Send(htmlPageBuilder, "Subject Line");
// Create an HTML email body
var page = HTMLPageBuilder.StartStandardEmailPage(
subject: "Welcome!",
title: "Welcome to Our App",
logger: _bwLogger,
methodName: "SendWelcomeEmail");
page.AddParagraph("Hello and welcome!");
page.AddStandardPageFooter();
page.EndDocument();
// Send the email
emailGroup.Send(page, "Welcome!");