Page 1 of 1

How do I add a variable subject line to my emails?

Posted: Fri Jun 17, 2016 3:24 pm
by joebahoe
I'm trying to add the customer's first name to the subject line of our emails.

Code: Select all

<bean id="blOrderConfirmationEmailInfo" parent="blEmailInfo">
        <property name="subject" value="CustomerFirstName, your order is on its way!"/>
        <property name="emailTemplate" value="shop-order-confirmation"/>
</bean>


I have not seen an example of this in the forums or anywhere else. Please help!

Thanks,

-- Joe

Re: How do I add a variable subject line to my emails?

Posted: Wed Nov 02, 2016 12:52 pm
by benhenda89
Greeting,
use EmailInfo.java

Code: Select all

<bean id="blOrderConfirmationEmailInfo" parent="blEmailInfo">
        <property name="emailTemplate" value="shop-order-confirmation"/>
</bean>


Code: Select all

@Resource("blOrderConfirmationEmailInfo)
 protected EmailInfo emailInfo;

emailInfo.setSubject(customer.getFirstName() + ", your order is on its way!");