Handlebars Helper Function: domain

Returns the domain portion of an email address, which is the text immediately after the at sign (@).

Availability

This helper is available in the Winter ’27 release of Marketing Cloud Next.

Syntax

{{domain emailAddress}}

Parameters

Parameter Type Description
emailAddress String Required. The email address to obtain the domain of.

Return Value

The function returns the domain portion of emailAddress. If emailAddress doesn't contain an at sign or isn't a string, the function returns null.

Usage Example

This example returns the domain portion of an email address.

{{domain "sales@example.com"}}

The function returns:

example.com

The helper returns the text after the first at sign. For example, {{domain "sales@force@example"}} returns force@example.