Hi
Is there a way to include the field description along with the field name in my admin notification email?
You can use the filter gform_merge_tag_filter to prepend or append the $field->description
to the value that is being returned within the {all_fields}
merge tag.
Something like the following will at least give you a start on what may be needed:
add_filter( 'gform_merge_tag_filter', function ( $value, $merge_tag, $options, $field, $raw_value ) {
if ( $merge_tag == 'all_fields' && $field->formId == 5 ) {
$value .= '<br>' . $field->description;
}
return $value;
}, 10, 5 );
Please note that the above code is only applying the code to notifications on formId == 5
. You can remove that check to apply to all forms or change the specific form you’d like to apply this.
Thank you - and sorry for being inexperienced at this level…
Do I add this block of code before or after what I already have, or do I replace the code with this?
I’m assuming this goes on the gw-all-fields-template. Correct?
Reference Where Do I Put This Code? for how to add a PHP snippet of this sort.
that seemed to work
thanks
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Jake More
Training and Program Coordinator
info@PrenatalVinyasaYoga.com
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Dolphin Method & Prenatal Vinyasa Yoga
DVDs, Books, Workshops, and Teacher Trainings
www.DolphinMethod.com
Find Jennifer More on Facebook and Instagram
www.facebook.com/Prenatalyoga | www.instagram.com/prenatalyoga