action dependency on another action

By: Gabe Herbert | Asked: 03/27/2023
ForumsCategory: General questionsaction dependency on another action
Gabe Herbert asked 1 year ago
I have one action that gets a value from an API. I have another action that sends a confirmation email, but I only want that to send depending on the value returned by the API.  To be more clear, the API call is registering a user for a Zoom meeting. The response is their join meeting URL- that gets stored in a field in the entry. If there is no join URL, there was a problem with the registration, so don't send a confirmation email! I see now that that won't work, because the send email action runs its conditional logic before the Zoom registration. At first I thought I needed to reorder the actions, but now I understand that the conditional logic is run first on all actions, before any actions are actually run. So it would seem that the Zoom API call must be run on a hook that runs before frm_after_update_entry, or at least before FrmFormActionsController::trigger_actions() runs on that hook.  So that starts to smell like I run the action outside of the actions queue, but then it's not really an action. Has anyone come up with a good way to deal with this?   TIA

Making the Best WordPress Plugin even better - Together

Take on bigger projects with confidence knowing you have access to an entire community of Formidable Experts and Professionals who have your back when the going gets tough. You got this!
Join the community
crossarrow-right