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.

Output Field Description

  1. I am using the gform_pre_submission_filter to alter my notification emails. I am checking first to see if the field has been filled out and if so, displaying it out in the email.

    I'd like to also be able to display the corresponding field's description in the email along with the user input. The email is being sent to a "customer service" desk and orders are fulfilled based on the description of the product. Really need to display this dynamically instead of me updating each time a field is changed.

    Here is a snippet of the current code.... Basically how do I call the description of a field? The description portion of this field was typed out by me as the "LVF Backpack/HVF - Wetlands..."

    if($_POST["input_65"] != '')
    $form["notification"]["message"] .=  "<strong><span style='font-size:11pt;font-family:Arial; color:#372A12'>LVF Backpack/HVF - Wetlands Pallet Quantitiy: " .$_POST["input_65"]. "</strong> D.C Mix Rate: 53.33% Rodeo, 6.67% Polaris, 13.33% AqufactEnd Use Mix Rate:15 makes 200 End Use Mix Rate: 4% Rodeo, 0.5% Polaris, 1% Aqufact15 makes 750 End Use Mix Rate: 1.067% Rodeo, 0.133% Polaris, 0.267% Aqufact</span>
    Posted 7 years ago on Tuesday August 7, 2012 | Permalink
  2. Based on this topic and the code you sent me, in your functions.php, looks like you figured this out. For anyone interested, the proper way to get the field description or field label:

    $label = $form["fields"][FieldID]["label"];
    $description = $form["fields"][FieldID]["description"];

    where FieldID is the actual numeric ID of the field you want to retrieve the description and label from. You can use this in a loop if you like, to go through all the fields.

    Posted 7 years ago on Monday August 27, 2012 | Permalink

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