Recent searches


No recent searches

Not sending email if blanks



Posted Oct 31, 2024

My company uses Macros to send basic information to our clients. There are fields we add to these macros, but not every client has information for each field. With that being said, sometimes there are sections of the Macros that are left blank, but the email will get sent with the blank information. 

 

Is there a way to have something check for these blanks and not let the email be sent without filling them out or taking them off?


0

1

1 comment

You can do this by including the following tricky wizardry when building your macro:

 

1. [text]
2. {% assign [field name] = [placeholder without the curvy brackets] %} {% if [field name] != '' %}
3. [Desired field name displayed in the notes]
4. {{ [field name] }} {% endif %}
5. [text]

 

Delete the numbers if you want to use this template, but this is what each line means:
1. This is text that will always appear
2. This is basically saying "if the ___ field is not blank, then include the following information" (being lines 3 and 4 in this case)
3. If you want the field data to have a title, this is where that would go
4. The data that is in the configured field
5. This is text that will always appear

 

For example, I'm using the "Additional Notes" text field with the field ID 5782141110939:

Thank you for reaching out
{% assign additional_notes = ticket.ticket_field_5782141110939 %} {% if additional_notes != '' %}
Additional Notes:
{{ additional_notes }}
{% endif %}
All the best,
Kyle

 

This is what it looks like when the Additional Notes field is blank:


And this is what it looks like when the Additional Notes field has data:

 

Obviously it's a case-by-case kind of thing, so you may need to make whatever changes needed for your setup to work. If you have any issues getting this setup, let me know and I'd be happy to help further.

0


Please sign in to leave a comment.

Didn't find what you're looking for?

New post