#V2-exclusive: Custom Dynamic Tags

arpReach has a limited number of dynamic tags.

The custom dynamic tag feature in #V2 allows you to create your own dynamic tags to use in messages. For example, the Date Tags with a plus (+) or minus (-) modifiers work due to the custom dynamic tags capability.

A #V2 installation has the file user_dynamic_tags.php in its /user_functions folder. You can add your own dynamic tags functions there.

The function names should begin with the prefix “dynamic_” to allow the system to detect them.

When #V2 processes a message and detects an unknown tag, it checks if a function with the name “dynamic_<tag>” exists. If yes, it runs this function with the $contact-object and the default tag-value and uses the result as the Tag value.

Important note: Your code must be designed to handle $contact being NULL and $default being an empty string.

Predefined Custom Dynamic Tags

{URLENCODE <value>} - encodes the value to use it in links. For example:

<a href="http://mysite.com/hello/?name={URLENCODE {FULL_NAME}}&amp;company={URLENCODE {COMPANY}}">hello</a> function dynamic_URLENCODE( $contact = NULL, $default = '' ) { return rawurlencode($default); }
{HTML_TO_TEXT} - converts an HTML-marked content into TEXT (plain text). You can use this for variables with HTML content to place them in plain-text part of your messages. For example:

{HTML_TO_TEXT {VARIABLE_MY_HTML_CONTENT}} function dynamic_HTML_TO_TEXT( $contact = NULL, $default = '' ) { return convert_html_to_text($default); }
{GRAVATAR_HASH} - allows you personalize messages with an avatar of your contact by using this image HTML code in your HTML messages:

<img src="https://www.gravatar.com/avatar/{GRAVATAR_HASH}.jpg" /> By default, images are presented at 80px by 80px if no size parameter is supplied. You may request a specific image size, which will be dynamically delivered from Gravatar by using the s= or size= parameter and passing a single pixel dimension (since the images are square): <img src="https://www.gravatar.com/avatar/{GRAVATAR_HASH}.jpg?size=200" /> You may request images anywhere from 1px up to 2048px. Read more at: https://gravatar.com/site/implement/images function dynamic_GRAVATAR_HASH( $contact = NULL, $default = '' ) { return md5(strtolower(empty($contact->email_address)? '': $contact->email_address)); }
{FULLNAME} - may compose full name from other parts of a name. Note that the {FULL_NAME} tag (with an underscore) is a different tag.

function dynamic_FULLNAME( $contact = NULL, $default = '' ) { if ( empty($contact) ) return $default; if ( empty($contact->full_name) ) { $contact->full_name = trim( implode(' ', array_filter(array( $contact->first_name, $contact->middle_name, $contact->last_name )))); } return empty($contact->full_name)? $default: $contact->full_name; }
{DATE_X <offset parameter>} - for date offsetting.

Offset by days {DATE_1 +1} {DATE_1 -3} {DATE_1 +1 day} {DATE_1 -3 days} Offset by weeks {DATE_1 +1 week} {DATE_1 -3 weeks} Offset in mixed format {DATE_1 +1 year 2 months 1 week 5 days} function dynamic_DATE_1( $contact = NULL, $default = '' ) { return _dynamic_FORMATED_DATE('date_format_1', $default); } function dynamic_SHORTDATE($contact = NULL, $default = '' ) { return _dynamic_FORMATED_DATE('date_format_1', $default); } function dynamic_DATE_2( $contact = NULL, $default = '' ) { return _dynamic_FORMATED_DATE('date_format_2', $default); } function dynamic_LONGDATE( $contact = NULL, $default = '' ) { return _dynamic_FORMATED_DATE('date_format_2', $default); } function dynamic_DATE_3( $contact = NULL, $default = '' ) { return _dynamic_FORMATED_DATE('date_format_3', $default); } function dynamic_USDATE( $contact = NULL, $default = '' ) { return _dynamic_FORMATED_DATE('date_format_3', $default); } function dynamic_DATE_4( $contact = NULL, $default = '' ) { return _dynamic_FORMATED_DATE('date_format_4', $default); } function dynamic_USLONGDATE( $contact = NULL, $default = '' ) { return _dynamic_FORMATED_DATE('date_format_4', $default); } function dynamic_DATE_5( $contact = NULL, $default = '' ) { return _dynamic_FORMATED_DATE('date_format_5', $default); } function dynamic_USLONGDATENOYEAR( $contact = NULL, $default = '' ) { return _dynamic_FORMATED_DATE('date_format_5', $default); } function dynamic_DATE_6( $contact = NULL, $default = '' ) { return _dynamic_FORMATED_DATE('date_format_6', $default); } function dynamic_EUROPEANDATE( $contact = NULL, $default = '' ) { return _dynamic_FORMATED_DATE('date_format_6', $default); } function dynamic_DATE_7( $contact = NULL, $default = '' ) { return _dynamic_FORMATED_DATE('date_format_7', $default); } function dynamic_WEEKDAY( $contact = NULL, $default = '' ) { return _dynamic_FORMATED_DATE('date_format_7', $default); } function dynamic_DATE_8( $contact = NULL, $default = '' ) { return _dynamic_FORMATED_DATE('date_format_8', $default); } function _dynamic_FORMATED_DATE($date_format = '', $default = '') { $CI =& get_instance(); $default = preg_replace('/^([+-]\s*[\d]+)$/', '$1 days', trim($default)); return app_date_offset( $CI->system_settings->{$date_format}, empty($default)? '': strtotime($default) ); }

System Settings Tags

System settings tags insert content from Setup / System Settings.

An optional default value will be inserted if the information is blank.

Important Note: The “[” and “]” (square brackets) in the subscription tags define the default value element but should not be included in your email.

Opt-in confirmation

{SYSTEM_CONFIRMATION_SUBJECT [default value]}
{SYSTEM_CONFIRMATION_TEXT [default value]}
{SYSTEM_CONFIRMATION_HTML [default value]}

Standard messages

{ANTI_SPAM_MESSAGE [default value]}
{PRIVACY_STATEMENT [default value]}

Contact and subscription management

{MANAGE_LINK_TEXT [default value]}
{EDIT_LINK_TEXT [default value]}
{NEXT_LINK_TEXT [default value]}
{UNSUBSCRIBE_LINK_TEXT [default value]}

Support resources

{SUPPORT_EMAIL_ADDRESS [default value]}
{SUPPORT_WEBSITE [default value]}

Resources box

{RESOURCE_BOX_TEXT [default value]}

Affiliate program

{AFFILIATE_ID [default value]}
{AFFILIATE_LINK_TEXT [default value]}
{AFFILIATE_LINK [default value]}
{AFFILIATE_AD [default value]}
{AFFILIATE_AD_TEXT [default value]}
{AFFILIATE_AD_HTML [default value]}

Note that {AFFILIATE_AD} and {AFFILIATE_AD_TEXT} are equivalent.

Date Tags

Date tags insert today’s date in one of the eight formats defined in Setup / System Settings / System / Date formats.

{DATE_1}
{DATE_2}
{DATE_3}
{DATE_4}
{DATE_5}
{DATE_6}
{DATE_7}
{DATE_8}

#V2-exclusive: Creative Date Tags

The date tags below allow you to change the date displayed either to a date in the past or a date in the future.

They can be used with or without the + (plus) or – (minus) modifiers.

For example, the date tag:

{SHORTDATE}

… is today. While the date tag:

{SHORTDATE +1}

… is today + (plus) one day. And the date tag:

{SHORTDATE -1}

… is today – (minus) one day.

Below are the creative date tags that you can use in arpReach, which also shows how the date modifiers: year, months, weeks, and days can be used. Your date can also be in European or US formats.

{SHORTDATE +3 days}
{LONGDATE -2 weeks}
{USDATE +1 year 2 months 1 week 5 days}
{USLONGDATE +5}
{USLONGDATENOYEAR -3 days}
{EUROPEANDATE +3}

{WEEKDAY}
{WEEKDAY +2}

 

Persona Tags

Persona tags insert information from the persona that you assigned to send the broadcast message or autoresponder sequence.

An optional default value will be inserted if the information is blank.

Important Note: The “[” and “]” (square brackets) in the subscription tags define the default value element but should not be included in your email.

{PERSONA_TITLE [default value]}
{PERSONA_FIRST_NAME [default value]}
{PERSONA_LAST_NAME [default value]}
{PERSONA_FULL_NAME [default value]}
{PERSONA_POSITION [default value]}
{PERSONA_DEPARTMENT [default value]}
{PERSONA_COMPANY [default value]}
{PERSONA_ADDRESS_1 [default value]}
{PERSONA_ADDRESS_2 [default value]}
{PERSONA_ADDRESS_3 [default value]}
{PERSONA_ADDRESS_4 [default value]}
{PERSONA_ADDRESS_5 [default value]}
{PERSONA_PHONE_NUMBER_1 [default value]}
{PERSONA_PHONE_NUMBER_2 [default value]}
{PERSONA_FAX_NUMBER_1 [default value]}
{PERSONA_FAX_NUMBER_2 [default value]}
{PERSONA_EMAIL_ADDRESS_1 [default value]}
{PERSONA_EMAIL_ADDRESS_2 [default value]}
{PERSONA_EMAIL_ADDRESS_3 [default value]}
{PERSONA_EMAIL_ADDRESS_4 [default value]}
{PERSONA_EMAIL_ADDRESS_5 [default value]}
{PERSONA_WEBSITE_1 [default value]}
{PERSONA_WEBSITE_2 [default value]}
{PERSONA_WEBSITE_3 [default value]}
{PERSONA_WEBSITE_4 [default value]}
{PERSONA_WEBSITE_5 [default value]}
{PERSONA_SIGNATURE_1 [default value]}
{PERSONA_SIGNATURE_2 [default value]}
{PERSONA_SIGNATURE_3 [default value]}
{PERSONA_SIGNATURE_4 [default value]}
{PERSONA_SIGNATURE_5 [default value]}
{PERSONA_RESOURCE_BOX_1 [default value]}
{PERSONA_RESOURCE_BOX_2 [default value]}
{PERSONA_RESOURCE_BOX_3 [default value]}
{PERSONA_RESOURCE_BOX_4 [default value]}
{PERSONA_RESOURCE_BOX_5 [default value]}
{PERSONA_OTHER_1 [default value]}
{PERSONA_OTHER_2 [default value]}
{PERSONA_OTHER_3 [default value]}
{PERSONA_OTHER_4 [default value]}
{PERSONA_OTHER_5 [default value]}

Variable, Ad, and Trackable Link Tags

An optional default value will be inserted if the information doest not exist or is blank.

Important Note: The “[” and “]” (square brackets) in the subscription tags define the default value element but should not be included in your email.

Variable Tags

Inserts the contents of a variable using the variable’s tag.

{VARIABLE_<tag> [default value]}
  • Example #1 – {VARIABLE_Price}
  • Example #2 – {VARIABLE_Price Call For Details}

Ad Tags

Inserts the plain text or HTML version of an ad using the ad’s tag.

{AD_<tag> [default value]} 
{AD_TEXT_<tag> [default value]} 
{AD_HTML_<tag> [default value]}
  • Example #1 – {AD_Membership_S}
  • Example #2 – {AD_Membership_S Invites Only}

Note that {AD_<tag>} and {AD_TEXT_<tag>} are equivalent.

Trackable Link Tags

Inserts the URL of a trackable link using the trackable link’s tag.

{LINK_<tag>}
  • Example #1 – {LINK_BBR01}
  • Example #2 – {LINK_ON02I03}

Broadcast Tags

Broadcast tags insert information from the broadcast being sent. These tags should NOT be inserted into follow-up messages.

An optional default value will be inserted if the information is blank.

Important Note: The “[” and “]” (square brackets) in the subscription tags define the default value element but should not be included in your email.

{SENDER_NAME}
{SENDER_EMAIL_ADDRESS}
{REPLY_TO_EMAIL_ADDRESS [default value]}

To insert a link to the online version of the broadcast:

{BROADCAST_ONLINE}
{BROADCAST_ONLINE_TEXT}
{BROADCAST_ONLINE_HTML}

Note that {BROADCAST_ONLINE} and {BROADCAST_ONLINE_TEXT} are equivalent.

To insert the header or footer at a place other than the top/bottom:

{HEADER_TEXT [default value]}
{HEADER_HTML [default value]}
{FOOTER_TEXT [default value]}
{FOOTER_HTML [default value]}

Subscription Tags

Subscription tags are used in an autoresponder’s follow-up messages. These tags should NOT be inserted into broadcast messages.

An optional default value will be inserted if the information is blank.

Important Note: The “[” and “]” (square brackets) in the subscription tags define the default value element but should not be included in your email.

{MESSAGE_COUNT} - the number of messages in the autoresponder.
{MESSAGE_NUMBER} - this message number in the autoresponder.
{SUBSCRIPTION_LENGTH} - the number of days since subscription.
{CONTACT_COUNT} - the number of unique autoresponder subscribers.

{SENDER_NAME}
{SENDER_EMAIL_ADDRESS}
{REPLY_TO_EMAIL_ADDRESS [default value]}

{SUBSCRIBE_IP_ADDRESS [default value]}
{SUBSCRIBE_USER_AGENT [default value]}
{CONFIRM_IP_ADDRESS [default value]}
{CONFIRM_USER_AGENT [default value]}

{UNSUBSCRIBE_IP_ADDRESS [default value]}
{UNSUBSCRIBE_USER_AGENT [default value]}

{SUBSCRIBE_DATE_1} - Date format #1 as defined in your Date formats settings.
{SUBSCRIBE_DATE_2} - Date format #2 as defined in your Date formats settings.
{SUBSCRIBE_DATE_3} - Date format #3 as defined in your Date formats settings.
{SUBSCRIBE_DATE_4} - Date format #4 as defined in your Date formats settings.
{SUBSCRIBE_DATE_5} - Date format #5 as defined in your Date formats settings.
{SUBSCRIBE_DATE_6} - Date format #6 as defined in your Date formats settings.
{SUBSCRIBE_DATE_7} - Date format #7 as defined in your Date formats settings.
{SUBSCRIBE_DATE_8} - Date format #8 as defined in your Date formats settings.

{TRACKING_TAG_NAME [default value]}
{AUTORESPONDER_CONFIRMATION_SUBJECT [default value]}
{AUTORESPONDER_CONFIRMATION_TEXT [default value]}
{AUTORESPONDER_CONFIRMATION_HTML [default value]}

{NEXT_LINK} - link to send the next message immediately.
{CONFIRM_LINK} - link to confirm subscription.
{UNSUBSCRIBE_LINK} - link to unsubscribe from this autoresponder only.
{RSS_FEED_LINK} - link to the RSS feed of the sequence.

Contact Tags

Contact tags insert information for the recipient contact.

An optional default value will be inserted if the information is blank.

Important Note: The “[” and “]” (square brackets) in the contact tags define the default value element but should not be included in your email.

For example, let’s use the tag:

Hi {FIRST_NAME there},

If the contact record has the First Name as John, the message would read as:

Hi John,

If, however, the contact record does not have a First Name, then the message would read as:

Hi there,

Contact Tags

{CONTACT_ID}
{EMAIL_ADDRESS}
{REFERER_ID [default value]} 
{TITLE [default value]}
{FIRST_NAME [default value]}
{MIDDLE_NAME [default value]}
{LAST_NAME [default value]}
{FULL_NAME [default value]}
{COMPANY [default value]}
{DEPARTMENT [default value]}
{ADDRESS_1 [default value]}
{ADDRESS_2 [default value]}
{ADDRESS_3 [default value]}
{CITY [default value]}
{STATE [default value]}
{POSTAL_CODE [default value]}
{PHONE_NUMBER_1 [default value]}
{PHONE_NUMBER_2 [default value]}
{PHONE_NUMBER_3 [default value]}
{MOBILE_PHONE_NUMBER_1 [default value]}
{MOBILE_PHONE_NUMBER_2 [default value]}
{MOBILE_PHONE_NUMBER_3 [default value]}
{FAX_NUMBER_1 [default value]}
{FAX_NUMBER_2 [default value]}
{FAX_NUMBER_3 [default value]}
{ALTERNATIVE_EMAIL_ADDRESS_1 [default value]}
{ALTERNATIVE_EMAIL_ADDRESS_2 [default value]}
{ALTERNATIVE_EMAIL_ADDRESS_3 [default value]}

To insert links specific to the recipient contact:

{MANAGE_LINK}
{EDIT_LINK}

To insert custom field information for the recipient contact:

{CUSTOM_<tag> [default value]}
  • Example #1 – {CUSTOM_hat_size}
  • Example #2 – {CUSTOM_hat_size info not available}

What is Dynamic Content?

Dynamic content is content that changes based on information stored within the database.

Using dynamic content saves you time and gives you great flexibility and versatility when creating message templates or broadcast and autoresponder messages.

Your dynamic content can be automatically included in messages and subject lines by using tags (or shortcodes).

In the following pages, explanations are given where the meaning is not obvious.

  • Mandatory parameters are inside angle brackets: <>
  • Optional parameters are inside square brackets: []

Important Note: You should remove the “[” and “]” (square brackets) when using optional parameters.