Jump to content
Outpower Hosting

Price Formatter Issue in Email Templates

Recommended Posts

I added the price formatter code in the invoice email template (eg: Invoice Reminder) to display the numeric value only. When this code is applied, the entire email loses HTML formatting and is being sent as a plain text email.

Code I used is:

{$invoice_balance->toNumeric()}

What can I do to retain the HTML format of the email while displaying the numeric value as I am using it to build a link without the currency code inside the email.

Share this post


Link to post
Share on other sites
On 08/02/2019 at 12:11, Outpower Hosting said:

I added the price formatter code in the invoice email template (eg: Invoice Reminder) to display the numeric value only. When this code is applied, the entire email loses HTML formatting and is being sent as a plain text email.

this is a long-standing bug/issue where the WHMCS email template editor tries to change > to > - even if you're using the source code popup window, it can still do it... 🙄

On 08/02/2019 at 12:11, Outpower Hosting said:

What can I do to retain the HTML format of the email while displaying the numeric value as I am using it to build a link without the currency code inside the email.

two thoughts...

firstly, edit the email template directly in phpmyadmin or similar - that will bypass the WHMCS editor... though if you go down this road, you will have to continue editing the template in the future directly, because the minute you try to edit it in WHMCS, it will make the > to > change again (until this issue is resolved).

the other way would be to abandon using toNumeric and just use a Smarty replace (or multiple replaces)...

{$invoice_balance|replace:'$':''|replace:'₹':''}

Share this post


Link to post
Share on other sites
On 2/9/2019 at 5:29 PM, brian! said:

the other way would be to abandon using toNumeric and just use a Smarty replace (or multiple replaces)...


{$invoice_balance|replace:'$':''|replace:'₹':''}

Thank You! This did the trick for now. I hope this is fixed in the future versions.

Share this post


Link to post
Share on other sites
17 hours ago, Outpower Hosting said:

I hope this is fixed in the future versions.

it's been around for a while, so there's no saying if/when it would be fixed.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×

Important Information

By using this site, you agree to our Terms of Use & Guidelines