Message personalization

table.php-doc td{

border: solid 1px silver;

border-collapse: collapse;

padding: 4px;

}

The Mailer application is capable of automatically adding various personal information about each recipient, stored in Contacts, to the message text; e.g., name, address, phone number, etc. This feature will allow you to send an individually addressed message to each recipient.

Menu item "Insert variable" adds contact's personal data to the message:

When a message is being sent each variable is replaced with its corresponding value, individual for each recipient (the name in this example).

Smarty

In addition to the variables available from the WYSIWYG editor's toolbar, you can also you arbitrary Smarty code to dynamically generate message content. For example, by using a special Smarty condition you can add an extra paragraph to the text only for those of your recipients who have a website URL specified in their profiles as shown below:

<strong>{if $url}</strong>  {* verifying that a website URL is stored in the $url variable *}

<p>To obtain detailed statistical information about your website, please use <a href="http://www.google.com/analytics/">Google Analytics</a>.</p>

<strong>{/if}</strong>

PHP functions

The message editor also supports use of PHP functions. For example, if you need to display the current year in each newsletter, you can simply add the following snippet without having to update your template once a year:

{date('Y')}

In this example date() is the PHP function used to display the current or other specified date in the certain format. "Y" is the date display format as explained in the documentation:

YA full numeric representation of a year, 4 digitsExamples: 1999, 2003

For detailed information on how to use Smarty and functions please consult the official documentation available on the following websites:

Smarty: http://www.smarty.net/docs/en/
PHP-функции: http://www.php.net/manual/en/funcref.php

0 comments

    Add comment

    To add a comment please sign up or login