SJEaton Posted May 4, 2017 Share Posted May 4, 2017 Hi I've been using a lot of Custom Variables e.g. {{.H_custom_a}} to pull through form responses into auto-emails. I have instances however where the customer may have left a field blank when they completed the online form so what happens is that when the email is received the customer sees {{.H_custom_a}} in the email text and will wonder what that is. Is there a way of presenting a blank instead of a variable name in instances like this? Thanks Samantha Link to comment Share on other sites More sharing options...
AlexTumber Posted May 4, 2017 Share Posted May 4, 2017 Hi Samantha, For this scenario you can use an esp condition on the field to only show it if it contains some data. Here is a link to a wiki page that you may find useful. https://wiki.hornbill.com/index.php/Email_Template_Variables Alex Link to comment Share on other sites More sharing options...
SJEaton Posted May 4, 2017 Author Share Posted May 4, 2017 Thanks Alex, this is cool but the example doesn't quite help me fully as it doesn't explain what I need to put in the Expression field if I just don't want a variable to show if a field value is blank. This is an example of the email I'm creating. Basically as the customer didn't enter info for a 3rd device I want {{.H_custom_f}} and {{.H_custom_g}} to not appear. Sam Link to comment Share on other sites More sharing options...
SJEaton Posted May 4, 2017 Author Share Posted May 4, 2017 example.doc Link to comment Share on other sites More sharing options...
Victor Posted May 4, 2017 Share Posted May 4, 2017 @SJEaton indeed, the wiki is not very explicit when it comes to expression configuration for variable empty value. So, for example, to cater for empty values of {{.H_custom_a}}, your expression needs the be like this: '{{.H_custom_a}}' NOT LIKE '%{.H_custom_a}%' Technical explanation: This is because if the {{.H_custom_a}} variable does not have a value, it does not actually evaluates to empty or NILL, it evaluates to the variable name as string. Hope this make sense 1 Link to comment Share on other sites More sharing options...
AlexTumber Posted May 4, 2017 Share Posted May 4, 2017 Hi Samantha, try this as an expression for each custom field: Alex 1 Link to comment Share on other sites More sharing options...
SJEaton Posted May 4, 2017 Author Share Posted May 4, 2017 Thank you!!! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now