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

#   Custom Subject in Confirmation email

##

- **[rkuiper](/forum/user/28454-rkuiper "View rkuiper's Profile")**
- [![rkuiper's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/gallery/vacation.jpg)](/forum/user/28454-rkuiper "View rkuiper's Profile") Topic Author
- [ Offline](/forum/user/28454-rkuiper)

Less More

- Posts: 79
- Thank you received: 2
-
-

10 years 11 months ago [\#224300](#224300) by [rkuiper](/forum/user/28454-rkuiper "View rkuiper's Profile")  *[Custom Subject in Confirmation email](/forum/27-checkout/881122-custom-subject-in-confirmation-email#224300 "-- HikaShop version -- : 2.6.0 -- Joomla version -- : 3.4.6 -- PHP version -- : 5.4.38  Hi, I set up the confirmation email so that only some information show when the order&#95;status is &quot;confirmed&quot; and when the order&#95;status is &quot;shipped&quot;. Now what i would like to do is depending on the order&#95;status change the subject line. I have looked in the language file, but the status is %s. So what i tried to do in the pre-load of the confirmation email is the following:  Now i found the code $data-&gt;$mail-&gt;subject = 'Custom text for order confirmation; in one of the thread, but i can seem to make it work with the if statement. Any help would be appreciated. Thanks")* was created by *[rkuiper](/forum/user/28454-rkuiper "View rkuiper's Profile")*

-- HikaShop version -- : 2.6.0
-- Joomla version -- : 3.4.6
-- PHP version -- : 5.4.38

Hi,
I set up the confirmation email so that only some information show when the order_status is "confirmed" and when the order_status is "shipped".
Now what i would like to do is depending on the order_status change the subject line.
I have looked in the language file, but the status is %s.
So what i tried to do in the pre-load of the confirmation email is the following: Code:

if($data-&gt;order_status=='confirmed') { $data-&gt;$mail-&gt;subject = 'Custom text for order confirmation; } elseif($data-&gt;order_status=='shipped') { $data-&gt;$mail-&gt;subject = 'Custom text for shipped order'; }

Now i found the code $data-&gt;$mail-&gt;subject = 'Custom text for order confirmation; in one of the thread, but i can seem to make it work with the if statement.
Any help would be appreciated.
Thanks

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg4MTEyMi1jdXN0b20tc3ViamVjdC1pbi1jb25maXJtYXRpb24tZW1haWw/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: 86587
- Thank you received: 14326
-
-

10 years 11 months ago [\#224335](#224335) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Custom Subject in Confirmation email](/forum/27-checkout/881122-custom-subject-in-confirmation-email#224335 "-- HikaShop version -- : 2.6.0 -- Joomla version -- : 3.4.6 -- PHP version -- : 5.4.38  Hi, I set up the confirmation email so that only some information show when the order&#95;status is &quot;confirmed&quot; and when the order&#95;status is &quot;shipped&quot;. Now what i would like to do is depending on the order&#95;status change the subject line. I have looked in the language file, but the status is %s. So what i tried to do in the pre-load of the confirmation email is the following:  Now i found the code $data-&gt;$mail-&gt;subject = 'Custom text for order confirmation; in one of the thread, but i can seem to make it work with the if statement. Any help would be appreciated. Thanks")*

It should be $data-&gt;mail-&gt;subject and not $data-&gt;$mail-&gt;subject

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

- **[rkuiper](/forum/user/28454-rkuiper "View rkuiper's Profile")**
- [![rkuiper's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/gallery/vacation.jpg)](/forum/user/28454-rkuiper "View rkuiper's Profile") Topic Author
- [ Offline](/forum/user/28454-rkuiper)

Less More

- Posts: 79
- Thank you received: 2
-
-

10 years 11 months ago [\#224529](#224529) by [rkuiper](/forum/user/28454-rkuiper "View rkuiper's Profile")  Replied by *[rkuiper](/forum/user/28454-rkuiper "View rkuiper's Profile")* on topic *[Custom Subject in Confirmation email](/forum/27-checkout/881122-custom-subject-in-confirmation-email#224529 "-- HikaShop version -- : 2.6.0 -- Joomla version -- : 3.4.6 -- PHP version -- : 5.4.38  Hi, I set up the confirmation email so that only some information show when the order&#95;status is &quot;confirmed&quot; and when the order&#95;status is &quot;shipped&quot;. Now what i would like to do is depending on the order&#95;status change the subject line. I have looked in the language file, but the status is %s. So what i tried to do in the pre-load of the confirmation email is the following:  Now i found the code $data-&gt;$mail-&gt;subject = 'Custom text for order confirmation; in one of the thread, but i can seem to make it work with the if statement. Any help would be appreciated. Thanks")*

I tried it like you said. It didnt work. It still pulls the text from the language file (ORDER_STATUS_NOTIFICATION_SUBJECT)

I just did the line $data-&gt;mail-&gt;subject = 'Custom text for order confirmation;
without the if statement, but that doesnt matter either. Also first i had it at the bottom in the preload, then moved it to the top. But that doesnt matter either.

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

- **[rkuiper](/forum/user/28454-rkuiper "View rkuiper's Profile")**
- [![rkuiper's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/gallery/vacation.jpg)](/forum/user/28454-rkuiper "View rkuiper's Profile") Topic Author
- [ Offline](/forum/user/28454-rkuiper)

Less More

- Posts: 79
- Thank you received: 2
-
-

10 years 10 months ago [\#225570](#225570) by [rkuiper](/forum/user/28454-rkuiper "View rkuiper's Profile")  Replied by *[rkuiper](/forum/user/28454-rkuiper "View rkuiper's Profile")* on topic *[Custom Subject in Confirmation email](/forum/27-checkout/881122-custom-subject-in-confirmation-email#225570 "-- HikaShop version -- : 2.6.0 -- Joomla version -- : 3.4.6 -- PHP version -- : 5.4.38  Hi, I set up the confirmation email so that only some information show when the order&#95;status is &quot;confirmed&quot; and when the order&#95;status is &quot;shipped&quot;. Now what i would like to do is depending on the order&#95;status change the subject line. I have looked in the language file, but the status is %s. So what i tried to do in the pre-load of the confirmation email is the following:  Now i found the code $data-&gt;$mail-&gt;subject = 'Custom text for order confirmation; in one of the thread, but i can seem to make it work with the if statement. Any help would be appreciated. Thanks")*

I resolved the issue.

The following user(s) said Thank You: [Jerome](/forum/user/80-jerome "View Jerome's Profile")

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

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

Less More

- Posts: 32
- Thank you received: 1
-
-

9 years 6 months ago [\#270040](#270040) by [rjrsinc](/forum/user/45016-rjrsinc "View rjrsinc's Profile")  Replied by *[rjrsinc](/forum/user/45016-rjrsinc "View rjrsinc's Profile")* on topic *[Custom Subject in Confirmation email](/forum/27-checkout/881122-custom-subject-in-confirmation-email#270040 "-- HikaShop version -- : 2.6.0 -- Joomla version -- : 3.4.6 -- PHP version -- : 5.4.38  Hi, I set up the confirmation email so that only some information show when the order&#95;status is &quot;confirmed&quot; and when the order&#95;status is &quot;shipped&quot;. Now what i would like to do is depending on the order&#95;status change the subject line. I have looked in the language file, but the status is %s. So what i tried to do in the pre-load of the confirmation email is the following:  Now i found the code $data-&gt;$mail-&gt;subject = 'Custom text for order confirmation; in one of the thread, but i can seem to make it work with the if statement. Any help would be appreciated. Thanks")*

@rkuiper could you show how you were able to resolve this? I am too trying to have a custom subject in the order emails, in my scenario I'm checking against the payment method used. I also have not been able to get the subject to display other the the default "ORDER_CREATION_NOTIFICATION_SUBJECT"

I'm running Hikashop version 3.0 Business edition.

Any help on this would be great! Thanks!

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

- **[rkuiper](/forum/user/28454-rkuiper "View rkuiper's Profile")**
- [![rkuiper's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/gallery/vacation.jpg)](/forum/user/28454-rkuiper "View rkuiper's Profile") Topic Author
- [ Offline](/forum/user/28454-rkuiper)

Less More

- Posts: 79
- Thank you received: 2
-
-

9 years 6 months ago [\#270072](#270072) by [rkuiper](/forum/user/28454-rkuiper "View rkuiper's Profile")  Replied by *[rkuiper](/forum/user/28454-rkuiper "View rkuiper's Profile")* on topic *[Custom Subject in Confirmation email](/forum/27-checkout/881122-custom-subject-in-confirmation-email#270072 "-- HikaShop version -- : 2.6.0 -- Joomla version -- : 3.4.6 -- PHP version -- : 5.4.38  Hi, I set up the confirmation email so that only some information show when the order&#95;status is &quot;confirmed&quot; and when the order&#95;status is &quot;shipped&quot;. Now what i would like to do is depending on the order&#95;status change the subject line. I have looked in the language file, but the status is %s. So what i tried to do in the pre-load of the confirmation email is the following:  Now i found the code $data-&gt;$mail-&gt;subject = 'Custom text for order confirmation; in one of the thread, but i can seem to make it work with the if statement. Any help would be appreciated. Thanks")*

The way i solved it is with the following code: Code:

&lt;?php if($data-&gt;order_status=='confirmed') {$mail-&gt;subject = 'Custom Subject #1';} elseif($data-&gt;order_status=='processing') {$mail-&gt;subject = 'Custom Subject #2';} elseif($data-&gt;order_status=='packing') {$mail-&gt;subject = 'Custom Subject #3';} ?&gt;

This code i put into the HTML at the top of the ORDER_STATUS_NOTIFICATION_SUBJECT.

Im not for sure what you want is going to work. At least not into the "ORDER_CREATION_NOTIFICATION_SUBJECT" since that email is send out before payment is done. i would assume if you want it based on a certain payment method, that you have to get the field for the payment instead of the $data-&gt;order_status.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg4MTEyMi1jdXN0b20tc3ViamVjdC1pbi1jb25maXJtYXRpb24tZW1haWw/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.057 seconds

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