HtmlForgeX

API Reference

Class

EmailAlert

Namespace HtmlForgeX.Email
Assembly HtmlForgeX.Email
Implements
ILayoutAware ISpacingContainer IRoundable<EmailAlert> IRoundable IVisualElement<EmailAlert>

A compact, email-safe alert/callout block (info/success/warning/danger). Uses table markup and inline styles for broad email client compatibility.

Inheritance

Constructors

public EmailAlert() #

Initializes a new instance of the EmailAlert class.

Methods

public override Void EvaluateLayout(LayoutContext context) #
Returns: Void

Applies default border radius and spacing rules.

Parameters

context HtmlForgeX.Email.LayoutContext requiredposition: 0
public override String ToString() #
Returns: String

Renders the alert as email-safe HTML.

WithBackground 2 overloads
public virtual EmailAlert WithBackground(RGBColor color) #
Returns: EmailAlert

Sets the background color.

Parameters

color System.String requiredposition: 0
WithBackground(HtmlForgeX.Email.RGBColor color) #

Sets the background color using RGBColor.

Parameters

color HtmlForgeX.Email.RGBColor required
WithBorder 2 overloads
public virtual EmailAlert WithBorder(BorderWidth width, String customValue = null) #
Returns: EmailAlert

Sets the border width using a predefined size.

Parameters

width HtmlForgeX.Email.BorderWidth requiredposition: 0
customValue System.String = null optionalposition: 1
public virtual EmailAlert WithBorder(Boolean enabled) #
Returns: EmailAlert

Enables or disables borders for the alert.

Parameters

enabled System.Boolean requiredposition: 0
WithBorderColor 2 overloads
public virtual EmailAlert WithBorderColor(RGBColor color) #
Returns: EmailAlert

Sets the border color.

Parameters

color System.String requiredposition: 0
WithBorderColor(HtmlForgeX.Email.RGBColor color) #

Sets the border color using RGBColor.

Parameters

color HtmlForgeX.Email.RGBColor required
public EmailAlert WithBorderLeftWidth(String width) #
Returns: EmailAlert

Sets the left accent border width.

Parameters

width System.String requiredposition: 0
public virtual EmailAlert WithBorderRadius(String radius) #
Returns: EmailAlert

Sets the border radius.

Parameters

radius System.String requiredposition: 0
public EmailAlert WithIcon(String icon) #
Returns: EmailAlert

Sets a custom icon (emoji or short text).

Parameters

icon System.String requiredposition: 0
public EmailAlert WithMessage(String message) #
Returns: EmailAlert

Sets the alert message.

Parameters

message System.String requiredposition: 0
public EmailAlert WithoutIcon() #
Returns: EmailAlert

Hides the icon column.

WithRounded 2 overloads
public virtual EmailAlert WithRounded(Radius radius = Medium, String customValue = null) #
Returns: EmailAlert

Sets the border radius using a predefined size.

Parameters

radius HtmlForgeX.Email.Radius = Medium optionalposition: 0
customValue System.String = null optionalposition: 1
public virtual EmailAlert WithRounded() #
Returns: EmailAlert

Applies the default border radius (6px) for rounded corners.

public virtual EmailAlert WithRoundingMode(RoundingMode mode) #
Returns: EmailAlert

Sets the rounding mode for this alert.

Parameters

mode HtmlForgeX.Email.RoundingMode requiredposition: 0
public EmailAlert WithTextColor(String color) #
Returns: EmailAlert

Sets the text color.

Parameters

color System.String requiredposition: 0
public EmailAlert WithTitle(String title) #
Returns: EmailAlert

Sets the alert title.

Parameters

title System.String requiredposition: 0
public EmailAlert WithType(EmailAlertType type) #
Returns: EmailAlert

Sets the alert type and applies default colors.

Parameters

type HtmlForgeX.Email.EmailAlertType requiredposition: 0

Properties

public EmailAlertType Type { get; set; } #

Alert style preset.

public String Title { get; set; } #

Optional title rendered in bold.

public String Message { get; set; } #

Optional message rendered under the title.

public String Icon { get; set; } #

Optional icon (emoji or short text). If empty, a type-based icon is used.

public Boolean ShowIcon { get; set; } #

Whether to render the icon column.

public virtual String BackgroundColor { get; set; } #

Background color (light mode default).

public virtual String BorderColor { get; set; } #

Border color (light mode default).

public String TextColor { get; set; } #

Text color.

public virtual String BorderWidth { get; set; } #

Border width.

public String BorderLeftWidth { get; set; } #

Left accent border width.

public virtual String BorderRadius { get; set; } #

Border radius.

public virtual RoundingMode RoundingMode { get; set; } #

Controls how border radius is applied when no explicit radius is set.