Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extra Conditionals being omitted #21

Open
bonzidrine opened this issue Nov 23, 2015 · 1 comment
Open

Extra Conditionals being omitted #21

bonzidrine opened this issue Nov 23, 2015 · 1 comment

Comments

@bonzidrine
Copy link

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?

@gregorydavidjenkins
Copy link

gregorydavidjenkins commented Dec 5, 2016

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 %}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants