E-mail template - switch on age of {$customer.createdDatetime}

Dan Kamins's Avatar

Dan Kamins

16 Sep, 2013 05:28 AM

We need to send different e-mail text for "Payment Declined" in the case of a new customer (such as a mistake in typing their address during initial signup) vs. existing customer (such as declined due to card cancelled etc.).

I see there is "{$customer.createdDatetime}" available, but can you please show quickly how we could use this in an e-mail template? Say we want one text for created in the last 30 days, and another text for created further back than that.

Thanks!

  1. Support Staff 1 Posted by Marc Guyer on 17 Sep, 2013 03:47 PM

    Marc Guyer's Avatar

    Hi Dan -- I think you want to switch on the $invoice.isInitial value. That's a 1 or 0 indicating whether or not the invoice is the first one. You can, of course, do what you're suggesting with the customer $customer.createdDatetime value with something like:

    {if $customer.createdDatetime|date_format:"%s" < $smarty.now-60*60*24*30} created more than 30 days ago {/if}
    
  2. Jess Pendley closed this discussion on 21 Nov, 2013 07:49 PM.

Discussions are closed to public comments.
If you need help with Cheddar please start a new discussion.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

Recent Discussions

28 Mar, 2024 10:45 PM
24 Jan, 2024 08:33 AM
11 Jan, 2024 07:13 AM
30 Nov, 2023 02:07 AM
22 Nov, 2023 08:41 AM