HtmlForgeX

API Reference

Class

EmailProductCard

Namespace HtmlForgeX.Email
Assembly HtmlForgeX.Email
Base Element
Implements
Modifiers sealed

Email-safe product card (image + title/description + price + optional CTA). Useful for order confirmations, product availability, upsells, wishlists and collections.

Inheritance

Constructors

Methods

public override String ToString() #
Returns: String
public EmailProductCard WithBadge(String text, String backgroundColor = null, String color = null) #
Returns: EmailProductCard

Sets badge.

Parameters

text System.String requiredposition: 0
backgroundColor System.String = null optionalposition: 1
color System.String = null optionalposition: 2
public EmailProductCard WithButton(String text, String href, EmailButtonStyle style = Primary, EmailButtonSize size = Medium, Boolean fullWidth = true) #
Returns: EmailProductCard

Sets CTA button.

Parameters

text System.String requiredposition: 0
href System.String requiredposition: 1
style HtmlForgeX.Email.EmailButtonStyle = Primary optionalposition: 2
size HtmlForgeX.Email.EmailButtonSize = Medium optionalposition: 3
fullWidth System.Boolean = true optionalposition: 4
public EmailProductCard WithDescription(String description) #
Returns: EmailProductCard

Sets description.

Parameters

description System.String requiredposition: 0
public EmailProductCard WithImage(String source, String alt = "", String href = null, String height = null) #
Returns: EmailProductCard

Sets image.

Parameters

source System.String requiredposition: 0
alt System.String = "" optionalposition: 1
href System.String = null optionalposition: 2
height System.String = null optionalposition: 3
WithPrice 2 overloads
public EmailProductCard WithPrice(String price, String oldPrice = null, String caption = "") #
Returns: EmailProductCard

Sets price labels.

Parameters

price System.String requiredposition: 0
oldPrice System.String = null optionalposition: 1
caption System.String = "" optionalposition: 2
public EmailProductCard WithPrice(Decimal price, String currencySymbol = "$", Int32 decimals = 2, CultureInfo culture = null, Nullable<Decimal> oldPrice = null, String caption = "") #
Returns: EmailProductCard

Sets price labels using numeric formatting.

Parameters

price System.Decimal requiredposition: 0
currencySymbol System.String = "$" optionalposition: 1
decimals System.Int32 = 2 optionalposition: 2
culture System.Globalization.CultureInfo = null optionalposition: 3
oldPrice System.Nullable{System.Decimal} = null optionalposition: 4
caption System.String = "" optionalposition: 5
public EmailProductCard WithTitle(String title, String href = null) #
Returns: EmailProductCard

Sets the title and optional link.

Parameters

title System.String requiredposition: 0
href System.String = null optionalposition: 1

Properties

public String ImageSource { get; set; } #

Image source URL/path/base64/cid.

public String ImageAlt { get; set; } #

Alt text for the product image.

public String ImageHeight { get; set; } #

Optional height attribute for the image (e.g., "180").

public String Href { get; set; } #

Optional link URL (applies to title and image when other links are not provided).

public String ImageHref { get; set; } #

Optional link URL wrapping the image.

public String TitleHref { get; set; } #

Optional link URL wrapping the title.

public String BadgeText { get; set; } #

Optional badge text shown above the title (e.g., "New", "-20%").

public String BadgeBackgroundColor { get; set; } #

Badge background color (theme-aware by default).

public String BadgeColor { get; set; } #

Badge text color.

public String Title { get; set; } #

Product title.

public String Description { get; set; } #

Optional product description.

public String Price { get; set; } #

Primary price text (e.g., "$49.00").

public String OldPrice { get; set; } #

Optional secondary price text (e.g., "$99.00").

public String PriceCaption { get; set; } #

Optional small caption next to price (e.g., "/month").

public String BackgroundColor { get; set; } #

Background color (theme-aware by default).

public String BorderColor { get; set; } #

Border color.

public String BorderRadius { get; set; } #

Border radius.

public String CardPadding { get; set; } #

Card padding (applies to the content area below the image).

public String TitleColor { get; set; } #

Title color (theme-aware by default).

public String DescriptionColor { get; set; } #

Description color (theme-aware by default).

public Boolean UseDescriptionOpacity { get; set; } #

When true, renders description with reduced opacity instead of a hard-coded muted color.

public Double DescriptionOpacity { get; set; } #

Opacity used for description when UseDescriptionOpacity is enabled.

public String PriceColor { get; set; } #

Price color (theme-aware by default).

public String OldPriceColor { get; set; } #

Old price color (theme-aware by default).

public String ButtonText { get; set; } #

Optional CTA button text.

public String ButtonHref { get; set; } #

Optional CTA URL (defaults to Href when empty).

public EmailButtonStyle ButtonStyle { get; set; } #

CTA button style.

public EmailButtonSize ButtonSize { get; set; } #

CTA button size.

public Boolean FullWidthButton { get; set; } #

When true, the CTA button is rendered full width.