I have a custom post type "Shipments"
It is configured to send an email to customers whenever a change is made to the post on the back end (or front end).
I want to only send the email if a checkbox is "enabled" for any given post.
So I added the custom field "Customer Email Enabled".
I was expecting it to show up in the CRED email notification configuration options.
I want to set a rule "Send email IF field equals 'Enabled' "
However, it does not appear as an available custom field.
Have I configured the custom field incorrectly?
See screenshots.
That is strange.
I can see both Checkbox fields that I set to save 0 like you or the default recommended "save nothing".
(Recommended because the "save 0" is not supported anymore by Views in Queries)
I can see both Fields when I add a notification to a Form and set conditions to be sent by field.
Can you test this with no other plugins, updated to the latest versions, and check wether or not it makes a difference on your install when you use a Checkbox Field that does NOT save 0 to the database (as it's set natively)?
If that does not help anything, can you add log in details?
==> As well, that condition basically listens to what you inserted to the Form Content Editor
So if there the field is not present, it cannot be in the notification settings
You may want to make sure you first autogenerate the form.
As well, that condition basically listens to what you inserted to the Form Content Editor
So if there the field is not present, it cannot be in the notification settings
You may want to make sure you first autogenerate the form.
Thank you. That was a key part of the puzzle.
I added the field to the CRED form and now it appears as a notification email option!
HOWEVER...
I'm not sure I have configured the custom field correctly.
See screenshot attached.
And in the email notification section should I be using the string "Enabled" or a numeric "1" or "0"?
When I set the condition to "all are true" it doesn't send.
If I set "any are true" it sends.
So apparently it is reading the second test as "false".
As said, I suggest not to use that 0 value.
It will not work in Views, and I suggest, not to use it elsewhere if not determinately needed.
I suggest to create a Custom Field that natively saves 1, or nothing.
Don't alter what the GUI suggests when creating the Field (as well do not use custom display values) if you do not explicitly need.
Then, once you created basically a venially checkbox field, you use that in the notifications by:
- adding the Field in the Form's Body
- Choosing "When Custom Fields are Modified"
- There choosing the Fields you want to listen to
- Set a comparison to the value (usually 1, or nothing)
That should work fine.
In this case such fields should not store or display "manipulated" data but as raw and simple as possible.
Conditions, are a complex process.
The more complex content you process with it, the more affected it becomes by failures or glitches.
(Not necessarily in the code)
Can you try with a "native" field setup?
Bingo!
Followed your clear instructions the second time and it works now!!
(still confused about what "venially" means)
Perhaps OTGS should remove deprecated interface elements if they don't work anymore?
I'm sure there is a reason for keeping them.
You can close the ticket.