GreenArrow Email Software Documentation

Link Replacements

Overview

Link Replacements provide a mechanism for modifying the destination and/or expiration of a SimpleMH link after the email has been sent.

Link Replacements are performed at the time of the click. The purpose of this is to allow links with mistakes in them to be fixed, or to shut down links that are being abused.

Link Replacements can be configured via the UI or the API.

Attributes

The following are the configurable attributes defined for Link Replacements.

Mail Class

When configured, this link replacement will only affect clicks associated with the specified Mail Class. The comparison is made case-insensitively.

If a Mail Class is set for a Link Replacement, and that Mail Class is deleted, the Link Replacement will be deleted as well. Link Replacements associated with a specific Mail Class do not appear on that Mail Class’s “References to This Mail Class” table.

May be no longer than 100 characters.

InstanceID

When configured, this link replacement will only affect clicks associated with the specified InstanceID. The comparison is made case-insensitively.

In order to specify InstanceID, Mail Class must be set.

May be no longer than 300 characters.

Notes

User-defined text description of the purpose of this link replacement.

May be no longer than 512 characters.

Match Type

The match type to perform when determining if this link replacement affects a particular click.

  • All links: All clicks that match the specified filters (Mail Class, InstanceID).
  • Exact match: Clicks where the original destination URL exactly matches Match Text and the specified filters (Mail Class, InstanceID).
  • Regular expression: Clicks where the original destination URL matches Match Text using regular expression comparison and the specified filters (Mail Class, InstanceID).
  • Match by linkid: Clicks where the link being clicked was defined using the data-ga-linkid="linkid" attribute and the content of that tag matches this value. The specified filters (Mail Class, InstanceID) also apply.
Match Text

The string to use when comparing for match types of Exact match and Regular expression.

May be no longer than 10240 characters (we don’t recommend having URLs this long).

Link ID

The string to use when comparing for match type of Match by linkid.

Rewrite links that match the above criteria

Specify that you want to rewrite links that match this Link Replacement.

Replacement URL

The new URL to use in place of the original URL. If this is blank, no replacement will be made.

May be no longer than 10240 characters (we don’t recommend having URLs this long).

Use capture references (\1 through \9) when replacing the URL

If match type is Regular expression, then Match Text may containing capturing groups and Replacement URL may contain capture references.

  • If this is enabled, then: In Replacement URL, the text \1 will be replaced with the characters captured by the first regex capture sequence. This continues from \2 through \9. Additionally, in the text \\ will be replaced with a single backslash. There are other undocumented backslash-escaped sequences (which are subject to change in the future), so we strongly recommend that all backslashes that are not part of a \\ or \1 (etc) replacement codes be escaped as \\.
  • If this is disabled, none of these replacements will be made.
Expire links that match the above criteria

Specify that you want to rewrite the link expiration time.

Expiration Time

If this link replacement matches for a click, and the current time has passed the value for Expiration Time, the user will be presented with the message link expired instead of being taken to the destination URL.

Link Replacements must be unique for their matching criteria – this means that only one Link Replacement can exist for any given combination of Mail Class, InstanceID, Match Type, Match Text, and Link ID.

Link Replacements are evaluated from most-specific to least-specific mailclass and instanceid settings:

  1. Mail Class and InstanceID is set
  2. Mail Class is set, InstanceID is not set
  3. Mail Class and InstanceID are not set

Additionally, if multiple matches are found, ties will be broken by specificity of the match_type:

  1. Match by linkid
  2. Exact match
  3. Regular expression
  4. All links

If there’s still a tie after the above evaluations, the earliest created (lowest id) Link Replacement will be used.


Copyright © 2012–2024 GreenArrow Email