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.

gform_get_field_value hook in RGFormsModel::get_lead_field_value()

  1. Is there a reason the gform_get_field_value_hook is disabled/commented in RGFormsModel::get_lead_field_value() ?

    Or is there another way/another hook to modify field values when sending notification mails - just for the mails, not affecting the values stored in the database.

    Posted 12 years ago on Wednesday July 27, 2011 | Permalink
  2. It really shouldn't have been commented out. Not sure why it was commented out, but it will be re-introduced in the next version.
    However, if all you need to do is change the notification emails, you should use the gform_pre_submission_filter (http://www.gravityhelp.com/documentation/page/Gform_pre_submission_filter)
    In that filter, you can change the contents of the notification before it goes out.

    Posted 12 years ago on Wednesday July 27, 2011 | Permalink
  3. Great, thanks for re-introducing it ;-)

    @gform_pre_submission_filter> the key for not being able to use it is: the modified entry will be stored in the database ... but we are storing it in the database in a serialized format (json) and just unserialize it for entry/lead display in the WP backend and in notification emails.

    Or is the return value of the gform_pre_submission_filter not used to store it in the database? - in that case, the documentation is kind of misleading.

    Posted 12 years ago on Wednesday July 27, 2011 | Permalink
  4. Ok. So you also want to modify the way the data is displayed in the entry pages.
    What I would suggest then, is that you use the gform_get_input_value (we haven't had a chance to document this hook yet, but it will eventually replace the gform_get_field_value hook).

    apply_filters("gform_get_input_value", $input_value, $lead, $field, $input_id)

    This hook fires for each input, which means it will fire multiple times for multi-input fields such as name and address. When fired on a multi-input field, the value of the $input_id parameter will have the ID of that specific input. When fired from a single-input field, $input_id will be blank.

    Posted 12 years ago on Wednesday July 27, 2011 | Permalink