Email Templates are used as the container for which email content is sent. Every email is sent using a template even if the template is a basic template. This article discuss how email templates are generated. Of course we are always available to generate a template per your specification, please reach out to us so we can get a proposal together for you.
Email templates are php files that ultimately generate html output. This html output, and, a plain text equivelant become the substance of your email. Our template processing engine allows you to specify variables that are substituted with actual content at the time the email is sent. This content can come from data you provide, or, system generated data. All variables start with a $, ex: $message.
Email templates are accessible only through the file manager and are stored in [root]\packages\ravid_crm\mail. Note that:
Templates are PHP files. The general template should look something like this:
t("Dear %s<br>I hope you're having a great day today.<br><br>Sincerely,<br>%s",$userInfo['name_first'],$siteSenderSignature);
is valid and a great way to display content.
The general format is: $[variable name]||"[null string]". Let me explain the parts:
Here's a few examples:
For example, $userInfo:name_first||"" is a valid variable
The following variables exist in the system and can be used in your templates:
Some variables can be used in templates which require the user to provide information. this information is usually provided at the time the email or marketing campaign is initiated. These variables follow a similar format to system variables but the template also must include a definition about how to collect the user info. This is in comment blocks at the top of the email. Consider this template:
There's a lot going on here. Let's walk through it:
It's always a good idea to syntax-check your templates before putting them into production. You can do this from the command line using the following command:
php -l <template file name>
For example, php -l general_email.php will test the file and display any syntax errors