Hi there,
I have returned $vars from EmailPreSend Hooks like this
Array (
[messagename] => Other Product/Service Welcome Email
[relid] => 805
[mergefields] => Array (
[service_first_payment_amount] => WHMCS\View\Formatter\Price Object (
[price:protected] => 350000
[currency:protected] => Array (
[id] => 1
[code] => IDR
[prefix] => Rp
[suffix] => IDR
[format] => 3
[rate] => 1.00000
)
[defaultFormat:protected] => {PREFIX}{PRICE}{SUFFIX}
[defaultCurrencyDescriptor:protected] => Array (
[format] => 1
[prefix] =>
[suffix] =>
)
)
How to print "350000" on price protected object from ['mergefields']['service_first_payment_amount']
I try $vars['mergefields']['service_first_payment_amount']->price;
But i get message Error: Cannot access protected property WHMCS\View\Formatter\Price::$price