HtmlForgeX

API Reference

Class

EmailHeading

Namespace HtmlForgeX.Email
Assembly HtmlForgeX.Email
Base Element
Implements
ILayoutAware ITextElement<EmailHeading>

Represents a heading element (H1-H6) for email layouts with email-safe styling. Successive headings use HeadingMargin while transitions to other components use ParagraphMargin.

Inheritance

Constructors

EmailHeading 3 overloads
public EmailHeading() #

Initializes a new instance of the EmailHeading class.

public EmailHeading(String content) #

Initializes a new instance of the EmailHeading class with content.

Parameters

content System.String requiredposition: 0
The heading content.
public EmailHeading(String content, Int32 level) #

Initializes a new instance of the EmailHeading class with content and level.

Parameters

content System.String requiredposition: 0
The heading content.
level System.Int32 requiredposition: 1
The heading level (1-6).

Methods

ApplyDefaultSizeForLevel() #

Applies default font size based on heading level.

public override String ToString() #
Returns: String

Renders the heading as HTML.

public virtual EmailHeading WithAlignment(Alignment alignment) #
Returns: EmailHeading

Sets the text alignment.

Parameters

alignment HtmlForgeX.Email.Alignment requiredposition: 0
public EmailHeading WithBold() #
Returns: EmailHeading

Makes the heading text bold.

public EmailHeading WithCenter() #
Returns: EmailHeading

Centers the heading text.

WithColor 2 overloads
public virtual EmailHeading WithColor(RGBColor color) #
Returns: EmailHeading

Sets the text color.

Parameters

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

Sets the text color using RGBColor.

Parameters

color HtmlForgeX.Email.RGBColor required
public EmailHeading WithContent(String content) #
Returns: EmailHeading

Sets the heading content.

Parameters

content System.String requiredposition: 0
public virtual EmailHeading WithFontFamily(String fontFamily) #
Returns: EmailHeading

Sets the font family.

Parameters

fontFamily System.String requiredposition: 0
WithFontSize 2 overloads
public virtual EmailHeading WithFontSize(EmailFontSize fontSize) #
Returns: EmailHeading

Sets the font size.

Parameters

fontSize System.String requiredposition: 0
WithFontSize(HtmlForgeX.Email.EmailFontSize fontSize) #

Sets the font size using predefined values.

Parameters

fontSize HtmlForgeX.Email.EmailFontSize required
WithFontWeight 2 overloads
public virtual EmailHeading WithFontWeight(FontWeight fontWeight) #
Returns: EmailHeading

Sets the font weight.

Parameters

fontWeight System.String requiredposition: 0
WithFontWeight(HtmlForgeX.Email.FontWeight fontWeight) #

Sets the font weight using predefined values.

Parameters

fontWeight HtmlForgeX.Email.FontWeight required
public EmailHeading WithLeft() #
Returns: EmailHeading

Aligns the heading text to the left.

public EmailHeading WithLevel(Int32 level) #
Returns: EmailHeading

Sets the heading level (1-6).

Parameters

level System.Int32 requiredposition: 0
public virtual EmailHeading WithLineHeight(String lineHeight) #
Returns: EmailHeading

Sets the line height.

Parameters

lineHeight System.String requiredposition: 0
public EmailHeading WithRight() #
Returns: EmailHeading

Aligns the heading text to the right.

WithTextDecoration 2 overloads
public virtual EmailHeading WithTextDecoration(TextDecoration decoration) #
Returns: EmailHeading

Sets the text decoration.

Parameters

textDecoration System.String requiredposition: 0
WithTextDecoration(HtmlForgeX.Email.TextDecoration decoration) #

Sets the text decoration using predefined options.

Parameters

decoration HtmlForgeX.Email.TextDecoration required

Properties

public String Content { get; set; } #

Gets or sets the heading content.

public Int32 Level { get; set; } #

Gets or sets the heading level (1-6).

public virtual String FontFamily { get; set; } #

Gets or sets the font family.

public virtual String FontSize { get; set; } #

Gets or sets the font size.

public virtual String LineHeight { get; set; } #

Gets or sets the line height.

public virtual String Color { get; set; } #

Gets or sets the text color.

public virtual String TextAlign { get; set; } #

Gets or sets the text alignment.

public virtual String FontWeight { get; set; } #

Gets or sets the font weight.

public virtual String TextDecoration { get; set; } #

Gets or sets the text decoration.