Logo

Email Groups

BW.Framework uses EmailGroup objects to manage email recipients and sending.

Built-in Email Groups

Group Description Usage
EmailGroup.SysAdmin System administrators Critical alerts, startup failures

Creating Custom Email Groups

// 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");

Using HTMLPageBuilder for Email Body

// 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!");