• Resolved marcomarco90

    (@marcomarco90)


    Hi @wpmudev-support6,
    i have a problem: when I fill out the form, an email is sent with the contents, but the checkbox items are shown horizontally instead of vertically.
    I need them to be shown like that:

    {checkbox-1}
    – [DATA]
    – [DATA]
    – [DATA]

    When i receive the email notification, datas are currently displayed horizontally.

    May you suggest me anything?

    Kind regards,
    Marco

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Williams – WPMU DEV Support

    (@wpmudev-support8)

    Hi @marcomarco90

    I hope you’re well today!

    This will require additional code snippet and I’m not yet sure if it would be easily doable without plugin modification.

    I’ve asked our Forminator Team to take a look into it and we’ll update you here when we got feedback (or, hopefully, working code) from them.

    Kind regards,
    Adam

    Plugin Support Dimitris – WPMU DEV Support

    (@wpmudev-support6)

    Hello there @marcomarco90

    You can use the following snippet in a new MU plugin file (more details here: https://wpmudev.com/docs/using-wordpress/installing-wordpress-plugins/#installing-mu-plugins) and that should suffice. ??

    <?php
    add_filter( 'forminator_custom_form_after_render_value', function ( $value, $custom_form, $slug, $data ) {
    	if ( strpos( $slug, 'checkbox' ) !== false ) {
    		$value = ! empty( $value )
    			? '&mdash; ' . str_ireplace( ',', '<br />&mdash; ', $value )
    			: $value;
    	}
    	return $value;
    }, 10, 4);
    
    add_filter( 'forminator_replace_form_data', function( $content, $data, $original_content ) {
    	if ( substr( $original_content, 0, 1 ) === '{' &&  preg_match( '/^{(checkbox)-\d}$/m', $original_content ) ) {
    		$GLOBALS['_fm_cfields'][ $content ] = ! empty( $content )
    			? '&mdash; ' . str_ireplace( ',', '<br />&mdash; ', $content )
    			: $content;
    	}
    	return $content;
    }, 10, 4);
    
    add_filter( 'forminator_custom_form_mail_admin_message', function( $message, $custom_form, $data, $entry, $instance ) {
    	if ( ! empty( $GLOBALS['_fm_cfields'] ) ) {
    		foreach ( $GLOBALS['_fm_cfields'] as $slug => $value ) {
    			$message = str_ireplace( $slug, $value, $message );
    		}
    	}
    	return $message;
    }, 10, 5);

    Warm regards,
    Dimitris

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Forminator Email notification – Checkbox display’ is closed to new replies.