Target Non-US In Customer Order Notification Email Template
-
- Ensign (ENS)
- Posts: 20
- Joined: Tue Jan 13, 2009 11:11 am
Target Non-US In Customer Order Notification Email Template
I would like some text to be inserted into the Customer Order Notification email template only when the customer is located outside of the US.
How do you target Non-US customers in the Customer Order Notification email template?
Thanks!
How do you target Non-US customers in the Customer Order Notification email template?
Thanks!
Give More Media
http://www.givemore.com/
http://www.givemore.com/
Re: Target Non-US In Customer Order Notification Email Template
What about comparing country code in Email template for example
Code: Select all
#If($customer.PrimaryAddress.CountryCode!="US")
MESSAGE FOR NON US BASED CUSTOMER HERE
#end
-
- Ensign (ENS)
- Posts: 20
- Joined: Tue Jan 13, 2009 11:11 am
Re: Target Non-US In Customer Order Notification Email Template
Mazhar,
Thanks once again! I implemented the code below into our "Customer Order Notification" template, but it caused the email to output a bunch of random characters.
Have any idea why?
Here is an example of another customization we have used (for reference):
Thanks again for you help!
Thanks once again! I implemented the code below into our "Customer Order Notification" template, but it caused the email to output a bunch of random characters.
Have any idea why?
Here is an example of another customization we have used (for reference):
Code: Select all
#if (!${order.User.IsAnonymous})
You can track the progress of <a href="http://www.Blah.com/">your purchase here</a>.
#end
Give More Media
http://www.givemore.com/
http://www.givemore.com/
Re: Target Non-US In Customer Order Notification Email Template
Seems like you edited the Email template in FCK editor by clicking on edit icon next to Email template text area. There is a warning mentioned on FCK editor that it corrupts the NVelocity scrips if you use its design mode and save the data. Try making change simply into text area at proper location without using FCK editor.
-
- Ensign (ENS)
- Posts: 20
- Joined: Tue Jan 13, 2009 11:11 am
Re: Target Non-US In Customer Order Notification Email Template
Mazhar, once again you were exactly right! There was some corruption when working within the editor.
I ended up needing to slightly adjust the code above.
Here is the final code that targeted non-US customers:
Thanks again for the help.
I ended up needing to slightly adjust the code above.
Here is the final code that targeted non-US customers:
Code: Select all
#if($order.User.PrimaryAddress.CountryCode!="US")
Give More Media
http://www.givemore.com/
http://www.givemore.com/
-
- Ensign (ENS)
- Posts: 20
- Joined: Tue Jan 13, 2009 11:11 am
Re: Target Non-US In Customer Order Notification Email Template
Does anyone know the syntax for pulling the ship address country code in email templates?
Here is what I am guessing "$order.User.shipAddress.CountryCode" ...but this does not work.
Thanks!
Here is what I am guessing "$order.User.shipAddress.CountryCode" ...but this does not work.
Thanks!
Give More Media
http://www.givemore.com/
http://www.givemore.com/
Re: Target Non-US In Customer Order Notification Email Template
Shipping address relates to order. For customer its an address but upon order placement you can take one address as shipping or billing address. So you need to have order to get this information. See following code
Code: Select all
#foreach ($orderShipment in $order.Shipments)
$orderShipment.ShipToCountryCode
#end
-
- Ensign (ENS)
- Posts: 20
- Joined: Tue Jan 13, 2009 11:11 am
Re: Target Non-US In Customer Order Notification Email Template
Thanks Mazhar!
So, for anyone who needs it... to see if someone's shipping address is outside the US in an email template, you would do:
So, for anyone who needs it... to see if someone's shipping address is outside the US in an email template, you would do:
Code: Select all
#foreach ($orderShipment in $order.Shipments)
#if($orderShipment.ShipToCountryCode!="US")
Your order is being shipped outside the US...
#end
#end
Give More Media
http://www.givemore.com/
http://www.givemore.com/
Re: Target Non-US In Customer Order Notification Email Template
Yeah it would be something like that. Just one thing that one order can contain multiple shipments so it means if order contains two shipment one local and one for some different country then your message shouldn't say order will be shipped out side the country. It should tell him that shipment#blah would be sent out side of US.