Emailing Custom Snippet Data
-
I have been following “How to Create Custom Form Fields” using GiveWP Code Snippets. I can see the custom code snippet upon purchase complete, but I cannot find where this data is stored or displayed within GiveWP.
This is the example of code I’m using.
add_action( 'give_fields_donation_form_before_personal_info', function( $collection ) { $collection->append( give_field( 'text', 'Occupation' ) ->showInReceipt() ->label( __('Occupation') ) ->emailtag('my-occupation-tag') ->minLength(2) ->maxLength(30) ->placeholder('Your Occupation') ->storeAsDonorMeta() ->required() // Could instead be marked as readOnly() (optional) ->helpText( __( 'If you are retired - include RETIRED.' ) ) ); });
I followed this based on the example here:
https://givewp.com/documentation/developers/how-to-create-custom-form-fields/I added emailtag() with ‘my-occupation-tag’ as the value, however I just get “Occupation: {my-occupation-tag}” back in my email without the value. I was thinking I could use {meta_donor_Occupation} based on what I read here:
https://givewp.com/documentation/core/settings/emails/meta-email-tags/#other-examples
but I read “Keep in mind that these meta email tags only output the value of the tag, not the label at all.”Can you please help?
- The topic ‘Emailing Custom Snippet Data’ is closed to new replies.