• Resolved ejaganece

    (@ejaganece)


    Hi, I’m using the “Create Post” form and I received mail with Postdata ( with feature image and custom fields and the same custom fields data), please see my attachment image below. In that mail, the feature image looks very small and custom fields are displaying double times.

    Can you please tell me how can set the upload image URL instead for a small feature image and how can I hide the first custom fields inside post data?

    Thanks,
    Jagan

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Support Patrick – WPMU DEV Support

    (@wpmudevsupport12)

    Hi @ejaganece

    I hope you are doing well.

    I am afraid it is not possible out of the box, the custom field is being “repeated” because it shows the regular fields + mapping.

    We pinged our developers to verify if we have any hook to modify this behaviour, we can’t guarantee but we will take a look at this.

    Once hearing back from the developers we will let you know.


    Best Regards
    Patrick Freitas

    Plugin Support Amin – WPMU DEV Support

    (@wpmudev-support2)

    Hello @ejaganece ,

    Please try this code as mu-plugin (https://premium.wpmudev.org/docs/getting-started/download-wpmu-dev-plugins-themes/#installing-mu-plugins )

    add_filter( 'forminator_custom_form_mail_admin_message', 'wpmudev_forminator_change_post_mail', 10, 5 );
    function wpmudev_forminator_change_post_mail( $message, $custom_form, $data, $entry, $cls ) {
    	if ( $custom_form->id != 3084 ) {
    		return $message;
    	}
    	
    	if ( !empty( $data['postdata-1'] ) ) {
    		if ( !empty( $data['postdata-1']['post-image'] ) ) {
    			$img_src = $data['postdata-1']['post-image']['uploaded_file'][0];
    			$message = preg_replace('/<img[^>]+\>/i', $img_src, $message); 
    		}
    		if ( !empty( $data['postdata-1']['post-custom'] ) ) {
    			foreach ( $data['postdata-1']['post-custom'] as $key => $post_custom ) {
    				$message = str_replace( '<li>'.$post_custom['key'].': '.$post_custom['value'].'</li>', '', $message);
    			}
    			$message = str_replace('<li><b>Custom fields:</b><br><ul class="bulleted"></ul></li>', '', $message);
    		}
    	}
    	
    	return $message;
    }

    You need to replace 3084 with your form’s ID.

    kind regards,
    Kasia

    Thread Starter ejaganece

    (@ejaganece)

    Thanks for the update, it’s almost cleared but still only one custom field displaying in postdata.

    Thanks,
    Jagan

    Plugin Support Nithin – WPMU DEV Support

    (@wpmudevsupport11)

    Hi @ejaganece,

    Could you please share the form export so that we could give a closer look regarding this?

    Please check the following doc on how to export a form:
    https://wpmudev.com/docs/wpmu-dev-plugins/forminator/#import-export

    If you are concerned about any sensitive information in the form export, then you can duplicate your form, remove any sensitive information, and then export it.

    You can share the export file via Google Drive, Dropbox or any cloud service in the next reply.

    Looking forward to your response.

    Kind Regards,
    Nithin

    Plugin Support Amin – WPMU DEV Support

    (@wpmudev-support2)

    Hello @ejaganece ,

    We haven’t heard from you for a week now, so it looks like you no longer need our assistance.

    Feel free to re-open this ticket if needed.

    Kind regards
    Kasia

    Thread Starter ejaganece

    (@ejaganece)

    Sorry for the late reply, please download here https://www.dropbox.com/s/oqyfu392r8b6ico/forminator-members-form-export.txt?dl=0

    Thanks,
    Jagan

    Plugin Support Williams – WPMU DEV Support

    (@wpmudev-support8)

    Hi @ejaganece

    Thanks for sharing the form!

    I checked and it is happening because of how the form is configured.

    The code that we shared is a custom code and it’s quite “sensitive”. The issue always happens with just a single, the same, custom field “mbrs_district” and that is because this custom field has two form fields mapped to it.

    In mapping those two fields are separated by space (blank character) and the replacement function doesn’t take that into account.

    Simplest way to solve this is to replace this in “mbrs_district” field mapping

    {select-4} {text-5}

    with this

    {select-4}{text-5}

    Kind regards,
    Adam

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Post Feature Image in Mail and post data format limit.’ is closed to new replies.