Adding merges to WHMCS email templates for custom fields
You may want to include information in an email template from a custom field that you have added or is part of our WHMCS modules. These are in addition to the ones listed within the bottom of the email template pages in the “Available Merge Fields” area within WHMCS.
To list the content of a custom field you’ll need to identify the name of the specific custom field(s).
On a hosting or SSL product these can be found under ‘Setup‘ > Products/Services > Products/Services. From here select “Edit” on the product that has the custom fields and navigate to the “Custom Fields” tab. Locate the desired custom field(s) and note down the name listed.
In order to show the content of the field on your email template you need to use the following format and ONLY include the name replacing ‘fieldnamehere’ using a-z 0-9 formatting. No spaces or capitals. So for a field named “Field Name Example 1” it would be “fieldnameexample1”
{$service_custom_field_fieldnameexample1}
Below we’ll also give the custom fields created and used as part of our WHMCS module on hosting products:
Server Hostname | {$service_custom_field_serverhostname} |
Server IP Address | {$service_custom_field_serveripaddress} |
Nameserver 1 | {$service_custom_field_nameserver1} |
Nameserver 2 | {$service_custom_field_nameserver2} |
Nameserver 3 | {$service_custom_field_nameserver3} |