Jump to content

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.

Link to comment
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:'₹':''}
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated