HtmlForgeX

API Reference

Class

EmailHead

Namespace HtmlForgeX.Email
Assembly HtmlForgeX.Email
Base Element
Implements

Represents the head section of an email document with email-specific meta tags and styling. This includes embedded CSS and viewport configuration used by email clients.

Inheritance

Constructors

public EmailHead(Email email) #

Initializes a new instance of the EmailHead class.

Parameters

email HtmlForgeX.Email.Email requiredposition: 0
The parent email document.

Methods

public EmailHead AddCssInline(String css) #
Returns: EmailHead

Adds inline CSS to the email head.

Parameters

css System.String requiredposition: 0
The CSS content to add.

Returns

The EmailHead object, allowing for method chaining.

public EmailHead AddEmailFoundationStyles() #
Returns: EmailHead

Adds the foundation email CSS styles from embedded resources.

Returns

The EmailHead object, allowing for method chaining.

public EmailHead AddHttpEquivMeta(String httpEquiv, String content) #
Returns: EmailHead

Adds a meta tag with http-equiv attribute.

Parameters

httpEquiv System.String requiredposition: 0
The http-equiv value.
content System.String requiredposition: 1
The content value.

Returns

The EmailHead object, allowing for method chaining.

public EmailHead AddMeta(String name, String content) #
Returns: EmailHead

Adds a meta tag to the email document.

Parameters

name System.String requiredposition: 0
The name of the meta tag.
content System.String requiredposition: 1
The content of the meta tag.

Returns

The EmailHead object, allowing for method chaining.

public EmailHead AddTitle(String title) #
Returns: EmailHead

Adds a title to the email document.

Parameters

title System.String requiredposition: 0
The title to add.

Returns

The EmailHead object, allowing for method chaining.

RegisterLibraries() #

Registers required libraries for EmailHead.

public override String ToString() #
Returns: String

Converts the EmailHead object to a string that represents the head section of an email document.

Returns

A string that represents the head section of an email document.

public Task<String> ToStringAsync() #
Returns: Task<String>

Asynchronously converts the EmailHead object to a string that represents the head section of an email document.

Returns

A task representing the asynchronous operation with the head section as string.

Properties

public String Title { get; set; } #

Gets or sets the title of the email document.

public String Charset { get; set; } #

Gets or sets the charset (default: utf-8).

public String Viewport { get; set; } #

Gets or sets the viewport meta content.

public String FormatDetection { get; set; } #

Gets or sets the format detection meta content.

public Boolean DisableAppleMessageReformatting { get; set; } #

Gets or sets whether to disable Apple message reformatting.

public String ColorScheme { get; set; } #

Gets or sets the color scheme meta content.

public String SupportedColorSchemes { get; set; } #

Gets or sets the supported color schemes.

public Boolean IncludeWebFontImports { get; set; } #

Gets or sets whether to include web font import snippets (non-MSO). Disabled by default because many email clients ignore or strip web fonts.

public List<HtmlTag> MetaTags { get; set; } #

Collection of additional meta tags.

public List<String> InlineStyles { get; set; } #

Collection of inline CSS styles.