0

How can i change a variable to uppercase / lowercase in transacional email?

I need to change the customer name

{{htmlescape var=$customer.name}}

and the store name

{{var store.getFrontendName()}}

Here's an attachment showing the problem:

email body and inline text

As you can see, I'm using css to uppercase word exemplo but inline preview text doesn't show as uppercase.

Already tried looking for another functions in templates without any success. Is there any documentation about transactional emails language being used?

Thanks in advance

1 Answer 1

1

You need to overwrite this file

/app/code/core/Mage/Sales/Model/Order.php

To

/app/code/local/Mage/Sales/Model/Order.php

and change below code to queueNewOrderEmail function

public function queueNewOrderEmail($forceMode = false)
{
..
..
    if ($this->getCustomerIsGuest()) {
        $templateId = Mage::getStoreConfig(self::XML_PATH_EMAIL_GUEST_TEMPLATE, $storeId);
        $customerName = strtoupper($this->getBillingAddress()->getName());
    } else {
        $templateId = Mage::getStoreConfig(self::XML_PATH_EMAIL_TEMPLATE, $storeId);
        $customerName = strtoupper($this->getCustomerName());
    }
..
..
}
2
  • It won't work that way, because i need show as uppercase in email preview, and css only shows when email is opened. I've already done it with css but isn't enough. Commented Dec 5, 2018 at 10:28
  • Check my updated answer
    – hardik
    Commented Dec 6, 2018 at 4:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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