Skip Navigation

[Resolved] Email Notifications & Conditional Statements

This support ticket is created 6 years, 4 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 8 replies, has 2 voices.

Last updated by julieP 6 years ago.

Assisted by: Nigel.

Author
Posts
#920842

I've noticed that the conditional button is no longer displayed for CRED email notifications. Is this intended? I've had some set up prior to Types 3.0 and they are still working but it occurred to me that maybe this functionality is likely to cease??

Thanks

#921082

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Screen Shot 2018-07-05 at 07.23.28.png

Hi Julie

I'm not sure what you mean.

Conditional notifications have been prone to bugs and so this section was completely re-written for this release and should work much more dependably.

I checked the UI between the last version and the new update and I can't see any differences.

I just created a new form and added a notification with a condition based upon a custom field in the form.

Can you clarify what you are seeing different?

#921146

Hi Nigel

Sorry I don't mean conditional statements to control when an email notification is sent, I mean conditional statements within the email body; there used to be a button labelled 'conditional' in the editor toolbar so we could display text/fields using the [wpv-conditional] shortcode.

#921159

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Julie

I just checked on a site with older plugin versions and I don't see it. Do you know a specific CRED version where the conditional button was included?

Are you sure you didn't manually enter the wpv-conditional shortcodes? Or maybe insert them in the form itself then copy and paste them into the notification email body?

#921180

Hi Nigel

It definitely existed pre 1.9.1. I raised an issue with it just over a year ago (https://toolset.com/forums/topic/conditional-button-in-email-notification-set-up-is-inactive/) so did add my conditional statements manually whilst waiting for the update. I didn't ever get to check whether it was actually resolved with 1.9.1 because by then I'd added all the conditional statements I wanted manually!! Now the button's not there at all so I'm wondering whether this is an oversight or an indication that the conditional shortcode isn't supposed to be used in the email body anymore (just concerned my content might end up being incorrect and I'd have no easy way of knowing).

#921320

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Julie

You are right, I went back further in time and found versions of CRED where the button was included (not sure if it worked), and by CRED 1.9.5 it seems to have disappeared.

I know from the internal tickets that there were issues about how buttons were included on the editor, and it may be that was never properly resolved.

But it is not the intention that support for Views shortcodes, including wpv-conditional, inside notification email bodies will be stopped, so your notification conditionals should continue to work, regardless of what happens to the button.

I've escalated this so the developers can take another look, and I'll keep you posted.

#1150605

Hi Nigel

I haven't worried about chasing up on this because I've not needed to add any new conditionals to email notifications and even if I did, I can add the code manually even if it's not the quickest method.

However I've now discovered that my existing wpv-conditionals are no longer returning the content they used to. If I roll back to CRED 2.1.1.2, they're fine, with CRED 2.1.2, they're not.

On the form, the user selects one of two options for one custom field (radio select) and other fields are then shown depending on that choice. In the email they are sent on form submission, their choice is confirmed. So this is the code I have in the email notification:-

[wpv-conditional if="( $(wpcf-my-choice) eq '1' )"][types field='custom-field-1'][/types][/wpv-conditional][wpv-conditional if="( $(wpcf-my-choice) eq '2' )"][types field='custom-field-2'][/types][/wpv-conditional]

With CRED 2.1.1.2, the User would see whatever content they added to either custom field 1 or custom field 2. Now they see the actual types shortcode (not the content): [types field='custom-field-1'][/types] or [types field='custom-field-2'][/types].

#1150742

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Julie

We have two current issues with Types shortcodes not displaying correctly in notifications, both of which will be fixed by pending updates.

In the meantime you can try the patches/workarounds described in these errata:

https://toolset.com/errata/types-shortcodes-are-not-expanding-in-toolset-forms-notifications/
https://toolset.com/errata/types-shortcodes-used-as-id-attribute-values-are-not-executed-in-forms-notifications/

(I think probably only the first one affects you.)

I'll revert this to escalated as the original issue is not resolved.

#1154632

Hi Nigel

I received an update from you via a different ticket that the conditional button in the email notification toolbar is being reinstated in the next but one Types upgrade so I'm going to close this but open a new one for the types fields shortcodes as the patch didn't change anything. I'll allocate to you if I can.