Support » Plugin: Forminator - Contact Form, Payment Form & Custom Form Builder » Fields without labels shown as field type in notification emails

  • Resolved JamesKoussertari

    (@jameskoussertari)


    Hi,

    I prefer my forms to use placeholders instead of labels.

    However in the email notifications when using the {all_fields} tag, it’s not clear which field relates to the submitted data because the heading is only showing as the field type (Text, Select, Number etc.).

    For example:

    Name
    Alex

    Email

    alex@……..

    Text
    6pm

    Text
    8pm

    Select
    party

    Number
    15

    Is there a way around this without having to build the notification email manually? This proves difficult because you don’t know which field belongs to what in the ‘Add form data’ dropdown.

    Perhaps a solution would be to display the placeholders when there are no labels present.

    Thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Dimitris – WPMU DEV Support

    (@wpmudev-support6)

    Hello there @jameskoussertari,

    hope you’re doing well and thanks for reaching us! 🙂

    I understand the point here, it seems that placeholders won’t be a safe choice though, as these are not required fields, like field label, that’s why the labels are being used in the emails.

    Unfortunately, this can be achieved by building manually the email content, which will also get you the form fields by label (and sorted by type).

    Perhaps a solution would be to display the placeholders when there are no labels present.

    This would probably make more sense, so I’ve shared it with our developers. I’ll keep you posted here about any development on this.

    Warm regards,
    Dimitris

    Plugin Support Dimitris – WPMU DEV Support

    (@wpmudev-support6)

    Hello there @jameskoussertari,

    hope you’re doing well! 🙂

    I had some feedback from our developers and it seems that you can use placeholders by using the following snippet in the functions.php file of your child theme or in a MU plugin.

    add_filter( 'forminator_custom_form_submit_field_data', function( $field_data_array, $form_id ){
    
        foreach ( $field_data_array as $key => $field ) {
    
            if ( '' == $field['value'] ) {
                $_field = Forminator_API::get_form_field( $form_id, $field['name'] );
                $field_data_array[$key]['value'] = isset( $_field['placeholder'] ) ? $_field['placeholder'] : '';
            }
    
        }
    
        return $field_data_array;
    
    }, 20, 2 );

    Please do let me know if further assistance is required here.
    Warm regards,
    Dimitris

    Plugin Support Dimitris – WPMU DEV Support

    (@wpmudev-support6)

    Hello @jameskoussertari,

    you haven’t heard back from you for a while, so I’ll mark this as resolved.
    Feel free to post back any updates and we can carry on troubleshooting. 🙂

    Take care,
    Dimitris

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Fields without labels shown as field type in notification emails’ is closed to new replies.