Link
A Link input is for standalone URLs in the Email Editor.
Works great for:
-
Button destinations
-
Image links
-
CTA URLs and other standalone destinations that should behave like a URL, not plain text
Use a Link input instead of Text String when the value should be validated as a URL or when you want to collect extra HTML attributes alongside the URL.
Validation is optional and can be enabled per input when needed:
-
Required can make the link mandatory before review/export
-
Must change from default can force the marketer to replace the starting destination
-
Regex can add an extra pattern rule for the URL value
URL rules
Link inputs also include URL-specific options:
-
Only allow https is enabled by default
-
Allow merge tags lets the field accept a merge tag such as
[destination_url]instead of a literal URL
If the current default value does not match these rules, the Template Editor shows the error and blocks saving until the default is fixed.
Custom link attributes
You can optionally define Custom Link Attributes on the input. Each attribute adds an extra field in the Email Editor so the marketer can set values such as:
-
data-*attributes for tracking -
aria-*attributes for accessibility -
other approved attributes you want to expose in a controlled way
Each custom attribute can also be marked as required. When a URL is present, Better Email blocks Review and export until every required attribute on that link has a non-empty value. The validation message is shown on the specific attribute field that needs attention.
The saved link value is an object with:
{
"url": "https://example.com",
"attributes": {
"data-campaign-id": "spring"
}
}
Using linkAttributes in Liquid
Use the linkAttributes Liquid filter when you want to render the configured custom attributes onto an anchor tag.
<a href="{{ cta.url }}" {{ cta | linkAttributes }}>Shop now</a>
<a href="https://example.com" data-campaign-id="spring">Shop now</a>
The filter only renders non-empty string attributes and safely escapes both attribute names and values before output.