Dyn-Mailto

About Dynamic Mailto

The dyn-mailto Wordpress plugin enables you to create mailto links that load differently depending on who visits the page, where they visit the page from, where on the site they see the link, and more. You create a mailto link by writing a template that, when it comes time to render to someone visiting your website, has the appropriate fields substituted where ever you've designated.

This plugin allows you to write dynamic mailto links that can access information about:

In addition to including relevant data in the link, dynamic mailto links can incorporate useful logical constructs, including if statements, loops and randomizing fields.

Writing Your Mailto

To create dynamic mailto links on your Wordpress site, use the Dynamic Mailto widget, available on under Appearance->Widgets. After adding the widget to your location of choice, you will be able to customize the display text of the link, as well as the various fields of the mailto, including the to, subject and body fields. Each of these textareas corresponds directly with all the components of a mailto link.

Using Data Fields

Dynamic mailto widgets are are created using the Twig templating language. All data fields are surrounded with double curly bracket tags.

{{ location_country }}

To ease writing your widget, a dropdown menu will appear wherever you have two open curly brackets. This menu will provide a list of all available fields for your dynamic mailto link.

Using Logical Fields

Along with incorporating dynamic data into your mailto link, you can also specify certain logic for your dynamic mailto template to follow when loaded. For example, the 'if' tag can be used to modify the content of your mailto link based on certain conditions.

{% if location_country_code == 'CA' %}
 This sentence will only appear in the mailto link if the person loading it is from canada.
{% endif %}

A list of all logical fields available to you when writing your dynamic mailto link is listed below, with relevant twig documentation.

Tags
if
for
apply
Filters
abs
capitalize
date
upper
lower
title
split
round
Functions
random
range
date
min
max

Questions and suggestions can be sent to murrelljenna@gmail.com