- Posts: 79
- Thank you received: 2
Custom Subject in Confirmation email
10 years 11 months ago #224300
by rkuiper
Custom Subject in Confirmation email was created by rkuiper
-- 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:
Now i found the code $data->$mail->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
-- 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->order_status=='confirmed') {
$data->$mail->subject = 'Custom text for order confirmation;
} elseif($data->order_status=='shipped') {
$data->$mail->subject = 'Custom text for shipped order';
}
Now i found the code $data->$mail->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 or Create an account to join the conversation.
10 years 11 months ago #224335
by nicolas
Replied by nicolas on topic Custom Subject in Confirmation email
It should be $data->mail->subject and not $data->$mail->subject
Please Log in or Create an account to join the conversation.
10 years 11 months ago #224529
by rkuiper
Replied by rkuiper on topic Custom Subject in Confirmation email
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->mail->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.
I just did the line $data->mail->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 or Create an account to join the conversation.
10 years 10 months ago #225570
by rkuiper
Replied by rkuiper on topic Custom Subject in Confirmation email
I resolved the issue.
The following user(s) said Thank You: Jerome
Please Log in or Create an account to join the conversation.
9 years 6 months ago #270040
by rjrsinc
Replied by rjrsinc on topic Custom Subject in Confirmation email
@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!
I'm running Hikashop version 3.0 Business edition.
Any help on this would be great! Thanks!
Please Log in or Create an account to join the conversation.
9 years 6 months ago #270072
by rkuiper
Replied by rkuiper on topic Custom Subject in Confirmation email
The way i solved it is with the following code:
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->order_status.
Code:
<?php
if($data->order_status=='confirmed')
{$mail->subject = 'Custom Subject #1';}
elseif($data->order_status=='processing')
{$mail->subject = 'Custom Subject #2';}
elseif($data->order_status=='packing')
{$mail->subject = 'Custom Subject #3';}
?>
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->order_status.
Please Log in or Create an account to join the conversation.
Time to create page: 0.085 seconds