Domain Function

The Domain function returns the domain of the email address (everything after the @ symbol). For example, using the domain function on ‘hello@ampscript.com’ will return ‘ampscript.com’

Example:

For example, you may only want the domain displayed in an email or CloudPage.



%%[
set @email = ‘hello@ampscript.com’

]%%
%%=Domain(@email)=%%

Output:

ampscript.com

Explanation:

Using the email address of ‘hello@ampscript.com’, to display just the domain of that string, using the Domain function can output everything after the @ symbol. This can be wrapped in an IF statement to only display content for specific domains.

Leave a Reply

Your email address will not be published. Required fields are marked *