HtmlForgeX

API Reference

Class

EmailPromoCodeCard

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

Email-safe promo code card (title/description + highlighted code + optional CTA). Useful for promotions, discounts, onboarding coupons and campaigns.

Inheritance

Constructors

Methods

public override String ToString() #
Returns: String
public EmailPromoCodeCard WithButton(String text, String href, EmailButtonStyle style = Primary, EmailButtonSize size = Medium, Boolean fullWidth = true) #
Returns: EmailPromoCodeCard

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 EmailPromoCodeCard WithCode(String code, String label = null) #
Returns: EmailPromoCodeCard

Sets promo code + optional label.

Parameters

code System.String requiredposition: 0
label System.String = null optionalposition: 1
public EmailPromoCodeCard WithDescription(String description) #
Returns: EmailPromoCodeCard

Sets description.

Parameters

description System.String requiredposition: 0
public EmailPromoCodeCard WithFootnote(String footnote) #
Returns: EmailPromoCodeCard

Sets an optional footnote.

Parameters

footnote System.String requiredposition: 0
public EmailPromoCodeCard WithTitle(String title) #
Returns: EmailPromoCodeCard

Sets title.

Parameters

title System.String requiredposition: 0

Properties

public String Icon { get; set; } #

Optional icon shown on the left (emoji or short text).

public String Title { get; set; } #

Primary title.

public String Description { get; set; } #

Optional description under the title.

public String Code { get; set; } #

Promo code displayed in the highlighted block.

public String CodeLabel { get; set; } #

Optional label shown above the code (e.g., "Use code").

public String BackgroundColor { get; set; } #

Background color of the card (theme-aware by default).

public String BorderColor { get; set; } #

Border color of the card.

public String BorderRadius { get; set; } #

Border radius.

public String CardPadding { get; set; } #

Card padding.

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 CodeBackgroundColor { get; set; } #

Code block background color.

public String CodeBorderColor { get; set; } #

Code block border color.

public String CodeColor { get; set; } #

Code text color.

public String CodeFontSize { get; set; } #

Code font size.

public String CodeLetterSpacing { get; set; } #

Code letter spacing.

public String CodePadding { get; set; } #

Code padding.

public Boolean DashedCodeBorder { get; set; } #

Whether to use a dashed border around the code block.

public String Footnote { get; set; } #

Optional footnote under the code block.

public String ButtonText { get; set; } #

Optional button text.

public String ButtonHref { get; set; } #

Optional button URL.

public EmailButtonStyle ButtonStyle { get; set; } #

Button style.

public EmailButtonSize ButtonSize { get; set; } #

Button size.

public Boolean FullWidthButton { get; set; } #

When true, renders the CTA button full width.