Email Placeholder Options

4 posts by 2 authors in: Forums > CMS Builder
Last Post: September 4, 2015   (RSS)

By Perchpole - August 27, 2015

Hello, All -

I've been putting together a couple of new email templates and an annoying issue has emerged...

Is it possible to (somehow) make a placeholder conditional? At the moment, if a value does not exist the placeholder leaves a blank line in the email. This is a bit of an annoyance!

:0/

Perch

By Dave - September 3, 2015

Hi Perch, 

There's no easy way to do that.  

One solution is to have the conditional login in your PHP code.  If you don't want the blank link after the placeholder just remove it in the email template and add a \n to the placeholder value.

Hope that helps!

Dave Edis - Senior Developer
interactivetools.com

By Dave - September 4, 2015

Hi Perch, 

No, there's no way to skip it.  Probably what I'd do in the code is something like this: 

$placeholders['shipping_address_lines'] = implode("\n", array($placeholders['shipping_address_line_1'], $placeholders['shipping_address_line_2'])); 

And then replace this:

#order.shipping_address_line_1#
#order.shipping_address_line_2#

With this: 

#order.shipping_address_lines#

Let me know if that works for you.

Dave Edis - Senior Developer
interactivetools.com