Transfer variables between GF Hooks [RESOLVED]

I’m looking for a way in PHP to transfer some variables between GF Hooks.

I’m using gform_after_submission_3 to do some post submission processing.
This creates a unique username based on values in the form and some things in a database.

I’m then using gform_notification_3 and gform_confirmation_3 to update the email sent and to update the confirmation message.

Problem is, how can I pass some additional data from gform_after_submission_3 to gform_notification_3 and gform_confirmation_3.

I’ve tried global PHP variables, but that does not work.
Is there some way to store session values within GF and pass the data that way??

Notifications and confirmations are processed before gform_after_submisison, so it is not possible to pass data from it to them.

You’ll need to use an earlier hook, such as gform_entry_post_save.

With that, you could include the data in the $entry array, and then access it in the form submission notifications and confirmations using the entry merge tag e.g. {entry:your_custom_key}.

The changes you make to $entry are not saved to the database.

1 Like

Perfect answer Richard. Thank you.
Never occured to me to check the order of the hooks being called.
Thank you.