• Resolved pillwax.software

    (@pillwaxsoftware)


    First of all thanks for your work to create this plugin. We tried all major form plugins for our customers, and always return to CF7 because of its simplicity and flexibility.

    Also your signature plugin allows us to create forms for registrations and many other use cases where a signature is needed.

    While working with it we wanted to have the signatures as embedded images in the email messages, which also makes them basically unnecessary to save on the webserver.

    As your signature field already returns the image Base64 encoded we modified your plugin this way:

    
    function wpcf7_manage_signature ($posted_data) {
    
    	foreach ($posted_data as $key => $data) {
    		if (is_string($data) && strrpos($data, "data:image/png;base64", -strlen($data)) !== FALSE){
    	        $data_pieces = explode(",", $data);
    	        $encoded_image = $data_pieces[1];
    			
    			// Make the signature available as Base64 encoded image for inline use in HTML Email
    			$posted_data[$key.'-inline'] = $data;
    			
    	        $decoded_image = base64_decode($encoded_image);
    	        $filename = sanitize_file_name(wpcf7_canonicalize($key."-".time().".png"));
    

    Now we simply add a tag with suffix “-inline” to the form post data, containing the Base64 encoded image.

    In the Email Template we use:

    
    <img src="[signature-inline"] />
    

    and the signature is being included on the HTML Email as embedded image without URL reference back to the server.

    Maybe you can include this in your upcoming updates, so we can keep this. Also this may be helpful to other users. By having the signature embedded into the email we do not need to create a PDF or such, we simply print the email and have the right documentation with the signature on.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author tameroski

    (@tameroski)

    Hi

    And thanks for your feedback.

    When i first released the plugin, it was using Base64 encoded inline images, but i had to change my mind because of support issues in a majority of email clients. And as far as i know, it’s still the same. That’s why i switched to server-stored images and attachments.

    However, it’s pretty easy for me to add an “inline” feature. And it could be usefull in some case where someone can’t write to the server’s filesystem for example.

    I’m in the process of refactoring the whole plugin at the moment. So i’ll try to add the feature meanwhile.

    Keep in touch

    Plugin Author tameroski

    (@tameroski)

    Hi,

    v4 of the plugin is now live. you can use inline images by adding a parameter to your field like this :
    [signature* my-signature inline]

    And still using an image tag in the final email :
    <img src="[my-signature]"/>

    Hope this will help.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Embed signatures as inline image into HTML email’ is closed to new replies.