Postmaster-for-Craft-CMS icon indicating copy to clipboard operation
Postmaster-for-Craft-CMS copied to clipboard

Extra Conditionals being omitted

Open bonzidrine opened this issue 10 years ago • 1 comments

When I add conditionals that should not validate (in other words, return false) the e-mail still gets send.

I check the entry type (Craft core data) and a custom field (entryLocale).

{% if entry.typeId != 6 %}false{% endif %}  
{% if entry.entryLocale != "nl" %}false{% endif %}

Whenever the entryLocale is, i.e. "fr" the parcel still sends an e-mail. Any ideas?

bonzidrine avatar Nov 23 '15 09:11 bonzidrine

From what I understand you need to write this code so that only one "false" can possibly get returned. The documentation does not currently make this clear, but if your code returns something like "falsefalse" that's not really being understood by Postmaster as false.

Try something like this:

{% if entry.typeId != 6 or entry.entryLocale != 'nl' %}false{% endif %}

gregorydavidjenkins avatar Dec 05 '16 19:12 gregorydavidjenkins