Is it possible to re-format custom field values in a mail merge HTML template in Salesforce? Like to remove a dollar sign, or the cents in a dollar amount?


While it's not officially documented, I believe you can use many Visualforce functions in email templates. You just have to manually write the function syntax.

For example, the following plain text email template will produce the output shown in the preview below.


Contact Name email template preview

  • Oh hey, cool. So we can use like Math.round() to get rid of decimals? Stripping dollar signs would be tougher I'd imagine, though. Or converting dollar amounts to cents. – okay56k Nov 23 '15 at 12:12
  • 1
    Math.round() is an Apex method, not a Visualforce function. Unfortunately I've only seen the ability to use Visualforce functions, not Apex methods. As for stripping dollar signs you may have to create a formula field that simply displays the numeric value of the currency field, and use that formula field in your email template. – Marty C. Nov 23 '15 at 12:31
  • FYI, using round works just fine. – okay56k Nov 23 '15 at 12:31

Whell, the real answer is NO, it is not possible for CUSTOM fields, it do is just for STANDARD fields.

  • 1
    Do you have a reference for this claim? – Adrian Larson Oct 18 '16 at 23:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.