Forums

[Solved] Email [GH] If Not Blank Condition

WhiteLighter01 10 Sep, 2013
Hi,

I'm currently trying to configure the Email [GH] event. What should I put in the condition to check if a certain text field is not blank? Currently, we have a weekly process that will query the table and process the information. What I would like to do is, if a user put additional instructions (special needs, food preference, etc.) on the comment box, I would like to send an email to that event's admin with all the information, so that the admin could make necessary adjustments/preparation. In short, the condition would be: if comment is not blank, send email.

Thanks
GreyHead 10 Sep, 2013
HI WhiteLighter,

From the Help Tab

The Conditional box is a new feature that allows you to make emails conditional on form inputs. Enter {input_name}::value to set a condition e.g. {send_email}::Yes. The Email will only be sent if the condition is met exactly. For reliabilty please test for text strings or numbers greater than zero, tests for empty strings '', 0 or 'false' will not be reliable



To test for an empty string use a Custom Code action before the Email [GH] action and add PHP to set a $form->data entry that is 1 if you want an email sent. Then use that in the Conditional box.

Bob
WhiteLighter01 10 Sep, 2013
Thanks Bob ^_^ I was thinking about that earlier as a workaround if there is no way to check for blank string.
This topic is locked and no more replies can be posted.