PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Dynamic Confirmation Message Based on Lead Information

  1. I want to change the confirmation message based on the lead information submitted, but both gform_pre_submission and gform_confirmation only accept the $form variable and it seems by the time I get to gform_post_submission I am too late for the confirmation message.

    How can I get the submitted information into these functions?

    If I use the validation hook it triggers on page next, etc.

    http://myfootpath-dev.com/request-information/american-intercontinental-university-online/#gf_125

    Thanks,
    Lindsey

    Posted 13 years ago on Wednesday April 20, 2011 | Permalink
  2. Hi Lindsey,

    You're going to want to use the gform_pre_submission_filter. You can retrieve the submitted form values from the global $_POST variable and update the confirmation message in the $form object passed by the hook. Let me know if you have any questions on this.

    Posted 13 years ago on Wednesday April 20, 2011 | Permalink
  3. Thank you. This is what I am doing (but in gform_confirmation filter) for some of my own simple validation, but I need to change the confirmation message based on the response from my post to a third party and it is too difficult to go through this process with only $_POST. Is it too late at this point to change the message?

    Maybe I could still send an email at this point?

    Also, would it be better to use the pre_submission filter rather than gform_confirmation filter?

    Thanks for the quick response!

    Posted 13 years ago on Thursday April 21, 2011 | Permalink
  4. Have you reviewed the documentation for the gform_confirmation hook? From your description, it meets all of your requirements. The entry details are available ($lead parameter) and it is specifically available for updating the confirmation message. Does this answer your question?

    Posted 13 years ago on Thursday April 21, 2011 | Permalink
  5. Sorry, I forgot that had the lead. I guess I could move all my post processing from post_submission into that function.

    Posted 13 years ago on Thursday April 21, 2011 | Permalink
  6. Let us know how it goes. :)

    Posted 13 years ago on Thursday April 21, 2011 | Permalink

This topic has been resolved and has been closed to new replies.