[Skip to main content](#vessel-content)

#   Override subject in mail template

##

- **[gvitry](/forum/user/39972-gvitry "View gvitry's Profile")**
- [![gvitry's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/39972-gvitry "View gvitry's Profile") Topic Author
- [ Offline](/forum/user/39972-gvitry)

Less More

- Posts: 28
- Thank you received: 5
-
-

5 years 10 months ago [\#328138](#328138) by [gvitry](/forum/user/39972-gvitry "View gvitry's Profile")  *[Override subject in mail template](/forum/35-orders-management/901639-override-subject-in-mail-template#328138 "-- HikaShop version -- : 4.2.2 -- Joomla version -- : 3.9.21 -- PHP version -- : 7.2.31  Hi,  Using system&gt;&gt;Emails, one is able to override the content of the emails sent to customers. We added a status (devis) for sending ProForma invoices to customers (asking for subventions). Hence, in the back-office we set some orders from created to &quot;Devis&quot;. At that time an Email is sent to the customers based on the &quot;Order status notification&quot; template. This particular template allows to adjust the content based on the status value (per status override). That's great. However I did not find a way to override the mail's subject &quot;per status&quot;. Is it possible ?  In this particular case, the mail subject should not be &quot;your order status has been modified&quot; since it's not yet an order. More, it is true for most of the status modification (canceled, shipped, etc...). Would be great to be able to change the mail's subject regarding the status notification nature.  Any suggestion ?  Thanks  Laurent p/o Grégoire Vitry")* was created by *[gvitry](/forum/user/39972-gvitry "View gvitry's Profile")*

-- HikaShop version -- : 4.2.2
-- Joomla version -- : 3.9.21
-- PHP version -- : 7.2.31

Hi,

Using system&gt;&gt;Emails, one is able to override the content of the emails sent to customers.
We added a status (devis) for sending ProForma invoices to customers (asking for subventions). Hence, in the back-office we set some orders from created to "Devis". At that time an Email is sent to the customers based on the "Order status notification" template. This particular template allows to adjust the content based on the status value (per status override). That's great. However I did not find a way to override the mail's subject "per status". Is it possible ?

In this particular case, the mail subject should not be "your order status has been modified" since it's not yet an order. More, it is true for most of the status modification (canceled, shipped, etc...). Would be great to be able to change the mail's subject regarding the status notification nature.

Any suggestion ?

Thanks

Laurent p/o Grégoire Vitry

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM1LW9yZGVycy1tYW5hZ2VtZW50LzkwMTYzOS1vdmVycmlkZS1zdWJqZWN0LWluLW1haWwtdGVtcGxhdGU/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86583
- Thank you received: 14324
-
-

5 years 10 months ago [\#328148](#328148) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Override subject in mail template](/forum/35-orders-management/901639-override-subject-in-mail-template#328148 "-- HikaShop version -- : 4.2.2 -- Joomla version -- : 3.9.21 -- PHP version -- : 7.2.31  Hi,  Using system&gt;&gt;Emails, one is able to override the content of the emails sent to customers. We added a status (devis) for sending ProForma invoices to customers (asking for subventions). Hence, in the back-office we set some orders from created to &quot;Devis&quot;. At that time an Email is sent to the customers based on the &quot;Order status notification&quot; template. This particular template allows to adjust the content based on the status value (per status override). That's great. However I did not find a way to override the mail's subject &quot;per status&quot;. Is it possible ?  In this particular case, the mail subject should not be &quot;your order status has been modified&quot; since it's not yet an order. More, it is true for most of the status modification (canceled, shipped, etc...). Would be great to be able to change the mail's subject regarding the status notification nature.  Any suggestion ?  Thanks  Laurent p/o Grégoire Vitry")*

Hi,

In the per status override you can add such PHP code to override the subject: Code:

&lt;?php $data-&gt;mail-&gt;subject = 'The subject I want for this specific status'; ?&gt;

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM1LW9yZGVycy1tYW5hZ2VtZW50LzkwMTYzOS1vdmVycmlkZS1zdWJqZWN0LWluLW1haWwtdGVtcGxhdGU/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[gvitry](/forum/user/39972-gvitry "View gvitry's Profile")**
- [![gvitry's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/39972-gvitry "View gvitry's Profile") Topic Author
- [ Offline](/forum/user/39972-gvitry)

Less More

- Posts: 28
- Thank you received: 5
-
-

5 years 10 months ago [\#328257](#328257) by [gvitry](/forum/user/39972-gvitry "View gvitry's Profile")  Replied by *[gvitry](/forum/user/39972-gvitry "View gvitry's Profile")* on topic *[Override subject in mail template](/forum/35-orders-management/901639-override-subject-in-mail-template#328257 "-- HikaShop version -- : 4.2.2 -- Joomla version -- : 3.9.21 -- PHP version -- : 7.2.31  Hi,  Using system&gt;&gt;Emails, one is able to override the content of the emails sent to customers. We added a status (devis) for sending ProForma invoices to customers (asking for subventions). Hence, in the back-office we set some orders from created to &quot;Devis&quot;. At that time an Email is sent to the customers based on the &quot;Order status notification&quot; template. This particular template allows to adjust the content based on the status value (per status override). That's great. However I did not find a way to override the mail's subject &quot;per status&quot;. Is it possible ?  In this particular case, the mail subject should not be &quot;your order status has been modified&quot; since it's not yet an order. More, it is true for most of the status modification (canceled, shipped, etc...). Would be great to be able to change the mail's subject regarding the status notification nature.  Any suggestion ?  Thanks  Laurent p/o Grégoire Vitry")*

Hi,

Thanks for your answer but I can't make it working. Editing the mail in "system", there are Two box "Main information" and "Sender information". The fist one contains the subject with a language constant.
Below there are three text edition area "Html Version", "Text Version" and "Preload". The first two ones are for the content of the message as far as I understand. Can't put your code there. And the last one is to preload variables used in the content templates....
Where should I put this code ? Should the subject language constant be considered as a default value ?

Thanks for your answer

Laurent

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM1LW9yZGVycy1tYW5hZ2VtZW50LzkwMTYzOS1vdmVycmlkZS1zdWJqZWN0LWluLW1haWwtdGVtcGxhdGU/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86583
- Thank you received: 14324
-
-

5 years 10 months ago [\#328264](#328264) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Override subject in mail template](/forum/35-orders-management/901639-override-subject-in-mail-template#328264 "-- HikaShop version -- : 4.2.2 -- Joomla version -- : 3.9.21 -- PHP version -- : 7.2.31  Hi,  Using system&gt;&gt;Emails, one is able to override the content of the emails sent to customers. We added a status (devis) for sending ProForma invoices to customers (asking for subventions). Hence, in the back-office we set some orders from created to &quot;Devis&quot;. At that time an Email is sent to the customers based on the &quot;Order status notification&quot; template. This particular template allows to adjust the content based on the status value (per status override). That's great. However I did not find a way to override the mail's subject &quot;per status&quot;. Is it possible ?  In this particular case, the mail subject should not be &quot;your order status has been modified&quot; since it's not yet an order. More, it is true for most of the status modification (canceled, shipped, etc...). Would be great to be able to change the mail's subject regarding the status notification nature.  Any suggestion ?  Thanks  Laurent p/o Grégoire Vitry")*

Hi,

No, you can't put that code in the subject input field.
As I said, you need to add it to a "per status override". And there is no such override for the subject input field anyways.
So you need to add it either to the HTML per status override or the preload per status override via the corresponding "per status override" button.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM1LW9yZGVycy1tYW5hZ2VtZW50LzkwMTYzOS1vdmVycmlkZS1zdWJqZWN0LWluLW1haWwtdGVtcGxhdGU/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[gvitry](/forum/user/39972-gvitry "View gvitry's Profile")**
- [![gvitry's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/39972-gvitry "View gvitry's Profile") Topic Author
- [ Offline](/forum/user/39972-gvitry)

Less More

- Posts: 28
- Thank you received: 5
-
-

5 years 10 months ago [\#328275](#328275) by [gvitry](/forum/user/39972-gvitry "View gvitry's Profile")  Replied by *[gvitry](/forum/user/39972-gvitry "View gvitry's Profile")* on topic *[Override subject in mail template](/forum/35-orders-management/901639-override-subject-in-mail-template#328275 "-- HikaShop version -- : 4.2.2 -- Joomla version -- : 3.9.21 -- PHP version -- : 7.2.31  Hi,  Using system&gt;&gt;Emails, one is able to override the content of the emails sent to customers. We added a status (devis) for sending ProForma invoices to customers (asking for subventions). Hence, in the back-office we set some orders from created to &quot;Devis&quot;. At that time an Email is sent to the customers based on the &quot;Order status notification&quot; template. This particular template allows to adjust the content based on the status value (per status override). That's great. However I did not find a way to override the mail's subject &quot;per status&quot;. Is it possible ?  In this particular case, the mail subject should not be &quot;your order status has been modified&quot; since it's not yet an order. More, it is true for most of the status modification (canceled, shipped, etc...). Would be great to be able to change the mail's subject regarding the status notification nature.  Any suggestion ?  Thanks  Laurent p/o Grégoire Vitry")*

Hi,

I'm sorry but I'm able to change the content of the mail but never the subject is modified whatever I do and wherever I put the code. The standard subject text is always sent.

Are you sure it's possible ?

Thanks

Laurent

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM1LW9yZGVycy1tYW5hZ2VtZW50LzkwMTYzOS1vdmVycmlkZS1zdWJqZWN0LWluLW1haWwtdGVtcGxhdGU/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Philip](/forum/user/34318-philip "View Philip's Profile")**
- [![Philip's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/34318-philip "View Philip's Profile")
- [ Offline](/forum/user/34318-philip)

Less More

- Posts: 4820
- Thank you received: 652
-
-

5 years 10 months ago [\#328285](#328285) by [Philip](/forum/user/34318-philip "View Philip's Profile")  Replied by *[Philip](/forum/user/34318-philip "View Philip's Profile")* on topic *[Override subject in mail template](/forum/35-orders-management/901639-override-subject-in-mail-template#328285 "-- HikaShop version -- : 4.2.2 -- Joomla version -- : 3.9.21 -- PHP version -- : 7.2.31  Hi,  Using system&gt;&gt;Emails, one is able to override the content of the emails sent to customers. We added a status (devis) for sending ProForma invoices to customers (asking for subventions). Hence, in the back-office we set some orders from created to &quot;Devis&quot;. At that time an Email is sent to the customers based on the &quot;Order status notification&quot; template. This particular template allows to adjust the content based on the status value (per status override). That's great. However I did not find a way to override the mail's subject &quot;per status&quot;. Is it possible ?  In this particular case, the mail subject should not be &quot;your order status has been modified&quot; since it's not yet an order. More, it is true for most of the status modification (canceled, shipped, etc...). Would be great to be able to change the mail's subject regarding the status notification nature.  Any suggestion ?  Thanks  Laurent p/o Grégoire Vitry")*

Hello,

Sorry for this question, but how do you process your test to see if the subject override works ?
Be specific in your answer please, help us to understand you with step by step, screenshot, and precisely the code you have added.

Awaiting these elements to be able to progress on your subject.
Regards

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM1LW9yZGVycy1tYW5hZ2VtZW50LzkwMTYzOS1vdmVycmlkZS1zdWJqZWN0LWluLW1haWwtdGVtcGxhdGU/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[gvitry](/forum/user/39972-gvitry "View gvitry's Profile")**
- [![gvitry's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/39972-gvitry "View gvitry's Profile") Topic Author
- [ Offline](/forum/user/39972-gvitry)

Less More

- Posts: 28
- Thank you received: 5
-
-

5 years 10 months ago [\#328309](#328309) by [gvitry](/forum/user/39972-gvitry "View gvitry's Profile")  Replied by *[gvitry](/forum/user/39972-gvitry "View gvitry's Profile")* on topic *[Override subject in mail template](/forum/35-orders-management/901639-override-subject-in-mail-template#328309 "-- HikaShop version -- : 4.2.2 -- Joomla version -- : 3.9.21 -- PHP version -- : 7.2.31  Hi,  Using system&gt;&gt;Emails, one is able to override the content of the emails sent to customers. We added a status (devis) for sending ProForma invoices to customers (asking for subventions). Hence, in the back-office we set some orders from created to &quot;Devis&quot;. At that time an Email is sent to the customers based on the &quot;Order status notification&quot; template. This particular template allows to adjust the content based on the status value (per status override). That's great. However I did not find a way to override the mail's subject &quot;per status&quot;. Is it possible ?  In this particular case, the mail subject should not be &quot;your order status has been modified&quot; since it's not yet an order. More, it is true for most of the status modification (canceled, shipped, etc...). Would be great to be able to change the mail's subject regarding the status notification nature.  Any suggestion ?  Thanks  Laurent p/o Grégoire Vitry")*

Hello,

Reading my first post and the others :
I understand and successfully sent an overridden specific mail to the customer when the status is changed from created to "devis" on the backend.
As far as the override concerns the body (content) of the mail.

Here how I do :

System--&gt;emails
Edit mail #4 on my system : Order status notification
In the main block named "HTML VERSION", I click on the "Per status override" button
I select the status "devis" and I change what ever I want to change in the edit area in the popup
Save the popup and save the email.
Then I go to the customer order set it back to "created" to reset his order and modifiy it again to "devis" and click on "notify customer".
The mail is sent and received with the modified content as expected.

So everything works perfectly as far as it concerns the mail's body.

I've tried to add the code given by Nicolas in the HTML VERSION block (per status override-&gt;devis popup) either at the beginning or at the end with no success (with or without the &lt;?php ?&gt; tags depends if I put it inside some already php lines or at the HTML level).
Also I tried on he preload version block (per status override-&gt;devis popup of course). but no success.

The mail is sent with always the same subject. The one indicated in the "Main Information" block by the language constant "ORDER_STATUS_NOTIFICATION_SUBJECT"

Are you able to alter the mail's subject while modifying the order status to created to , saying, "Pending" using this method ? If yes where do you put the code exactly ? Should I remove the content of the EMAIL SUBJECT in the MAIN INFORMATION block ?...

I'm using Hikashop over years now. I did some custom works on view and created some plugin (zoom registration, GoCardLess Prélèvement Payment plugin, etc...). So I think, I understand what I'm doing. I could make a mistake or misunderstand what it needs to be done. But I'd like to be sure it could be done. Did you try successfully ?

Regards,

Laurent

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM1LW9yZGVycy1tYW5hZ2VtZW50LzkwMTYzOS1vdmVycmlkZS1zdWJqZWN0LWluLW1haWwtdGVtcGxhdGU/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86583
- Thank you received: 14324
-
-

5 years 10 months ago [\#328490](#328490) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Override subject in mail template](/forum/35-orders-management/901639-override-subject-in-mail-template#328490 "-- HikaShop version -- : 4.2.2 -- Joomla version -- : 3.9.21 -- PHP version -- : 7.2.31  Hi,  Using system&gt;&gt;Emails, one is able to override the content of the emails sent to customers. We added a status (devis) for sending ProForma invoices to customers (asking for subventions). Hence, in the back-office we set some orders from created to &quot;Devis&quot;. At that time an Email is sent to the customers based on the &quot;Order status notification&quot; template. This particular template allows to adjust the content based on the status value (per status override). That's great. However I did not find a way to override the mail's subject &quot;per status&quot;. Is it possible ?  In this particular case, the mail subject should not be &quot;your order status has been modified&quot; since it's not yet an order. More, it is true for most of the status modification (canceled, shipped, etc...). Would be great to be able to change the mail's subject regarding the status notification nature.  Any suggestion ?  Thanks  Laurent p/o Grégoire Vitry")*

Hi,

My bad, the code should actually be: Code:

&lt;?php $mail-&gt;subject = 'The subject I want for this specific status'; ?&gt;

I had to run some tests and do some debugging to figure out what was missing.
Regarding were you put that code, as I already explained, you need to add it in the popup you get when you click on the per status override button of the preload section of the email.
I successfully tested this new code and can confirm it works when you change the status of the order in the backend.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM1LW9yZGVycy1tYW5hZ2VtZW50LzkwMTYzOS1vdmVycmlkZS1zdWJqZWN0LWluLW1haWwtdGVtcGxhdGU/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.125 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
