#461 Custom email template overrides

Posted in ‘Technical Support / Bugs’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Latest post by ulric gress on Sunday, 14 September 2025 07:47 UTC

ulric gress

Hi Olivier,

Just a question regarding email templates:

I noticed that the default email template file is located at
/administrator/components/com_j2store/views/emailtemplate/tpls/default.php.

To make sure my changes to the customer order confirmation email are update-safe, what is the recommended way to override this?
Should I create a template override (e.g. in /templates/mytemplate/html/com_j2store/emails/ ?) so it won’t be overwritten during J2Commerce updates?

I just want to be sure I am following the correct and future-proof method for customizing the customer emails.

Best regards,
Ulric

Olivier

Hi Ulric,

yes, you are right, if you modify default.php, it will be refreshed on update.

The best way is to go to administrator/components/com_j2store/views/emailtemplate/tpls and copy the default.php file, give it another name and use that file. You can create as many as you wish.

Since the files are not located into a /tmpl folder, it is not possible to override them through the standard Joomla overrides.

Olivier.

Growing Together

Help us get back to #1 in the Joomla Extension Directory by leaving us a 5-Star review here.

ulric gress

Hi Olivier,

On villavent.dk I’m running into some confusion with the email templates.

* Previously (free J2Store) we customized via template override and language files.
* Now on J2Commerce 4 PRO, the current template in use is not overwritten on update, but it only shows up in the simple editor (not in advanced), so it looks like it comes directly from the DB.
* When I try to add my own copy of `default.php` (e.g. `default_villavent.php`) in `/tpls/` and select it, I immediately get this error when sending the mail:
`0 Call to a member function getItems() on null`

What is the correct way to add and select a custom email template in J2C 4 PRO, and to make sure it’s update-safe?

Best regards,
Ulric

System Task
System Task
The ticket information has been edited by ulric gress (design@gress.dk).

Olivier

Hi Ulric,

To:

What is the correct way to add and select a custom email template in J2C 4 PRO, and to make sure it’s update-safe?

I have the same anwser:

The best way is to go to administrator/components/com_j2store/views/emailtemplate/tpls and copy the default.php file, give it another name and use that file.

The advanced editor is not a view of the simple editor. They are unrelated.

The simple editor's body is saved in the database, the advanced editor uses files.

The free version of J2Store was not allowing you to design emails in the backend, that is why you needed language overrides. There are no email template overrides in the free version of J2Store, only language overrides. If you wanted to update the body of the email, you add to change the content of J2STORE_ORDER_EMAIL_TEMPLATE_STANDARD_BODY.

As far as the error you are getting: try and not start the copied file name with 'default'. I did copy default.php, called it mydefault.php and it worked just fine on my test site.

Note that if the free version of J2Store was enough for you to send emails, you should not need the Advanced Temlplate File. The simple editor should be good enough, easier to use and what you see is what you get. If you want the exact copy of what you had in your previous store, just copy the content of the J2STORE_ORDER_EMAIL_TEMPLATE_STANDARD_BODY language override you had and put it in the editor.

I hope this clarifies things a bit better!

Olivier.

Growing Together

Help us get back to #1 in the Joomla Extension Directory by leaving us a 5-Star review here.

ulric gress

Hi Olivier,

Thanks for clarifying the difference between simple and advanced templates. That makes sense. For now I’ll stick with the simple editor, since it’s easier and update-safe for our use case.

One additional question: what is the correct way to link different email templates to different order statuses in J2C PRO?

Best regards,
Ulric

Olivier

No problem, Ulric.

If you want to have a different email for each order status, it's pretty simple: each email tempate has a 'order status' field you can set.

 

Olivier.

Growing Together

Help us get back to #1 in the Joomla Extension Directory by leaving us a 5-Star review here.

ulric gress

Hi Olivier,

Perfect, that’s exactly what I needed to know. Thanks for clearing that up to!
case closed :)

Best sunday regards,
Ulric

Stay Updated

Subscribe for free and be the first to know about the latest features, updates, and new additions.