Events in CF7 after PHP action not working?

mapme 23 Sep, 2022
Hi,
I have a form using a URL parameter to define specific a action path in the form.
www.url.com?action=newsubscriber
or
www.url.com?action=updatesubscriber
Depending on the action value, CF7 is hopefully going to take a different course using the "Events" advance setting in the PHP action, as per attached image. This seems to reflect how custom event switchers worked in earlier versions of CF.
However, neither custom event seems to be working for me. It's like the {data:action} value isn't being picked up.

Can you please take a look at the screenshot and let me know if something has changed compared to earlier versions of CF event switchers? Or, better yet, is there another place I can implement custom event switchers than I haven't yet found?

Thanks a lot.
mapme 23 Sep, 2022
Can't upload images on the forum😟
mapme 23 Sep, 2022
Here we go:
Events in CF7 after PHP action not working? image 1
mapme 23 Sep, 2022
Answer
Got it... I stick this into the PHP area:

if ( $this->data['action'] === "newsubscriber" ) {
return "newsubscriber";
}

if ( $this->data['action'] === "updatesubscriber" ) {
return "updatesubscriber";
}

Then I set up the Return events accordingly.!
You need to login to be able to post a reply.

VPS & Email Hosting 20% discount
hostinger