• Resolved theparcel

    (@theparcel)


    Hello fellow,

    I use some html tag in the petition description to have a better text-formattation. Unfortunately the email that is sent out when an user subscribe doesn’t support the html tags. I tried to figure out where the email is generated in the class.mail.php file, but can’t figure out how to render the html.

    Thank you
    Lorenzo

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

    (@123host)

    Hey Lorenzo,

    If you use HTML tags in the title, it won’t be supported anywhere, including displaying the title on the petition page.

    For security reasons I am not prepared to make this part of the plugin, however here are instructions to make HTML tags for the petition title work on the petition page and in emails.

    From version 1.15.2 you can edit the following

    /wp-content/plugins/speakout/includes/class.mail.php find line 37 that reads $replace = array( stripslashes($signature->honorific), stripslashes($signature->first_name), stripslashes($signature->last_name), stripslashes($petition->title), $confirmation_url ); and remove the stripslashes() from around the field you wish to allow HTML e.g. stripslashes($petition->title) becomes just $petition->title

    /wp-content/plugins/speakout/includes/emailpetition.php find line 77 that reads <h3>' . stripslashes( esc_html( $petition->title ) ) . '</h3> becomes <h3>' . esc_html( $petition->title ) . '</h3>

    I haven’t tested this, so let me know if it doesn’t work properly.

    Thread Starter theparcel

    (@theparcel)

    Thank you for your reply,

    i understand the security issue, so thank you again for your help in my project.

    This edit make work the petition title in the email and in the shortcode form, but the email body and footer is still not html.

    This is how i see the “read more” petition text: https://snag.gy/Qt7ank.jpg

    And this is how i see the petition text in the mail that an user receive when sign: https://snag.gy/6wdfoy.jpg

    i tried to remove the stripslashes() at line 77 in class.mail.php

    // construct email message
    		$email_message  =  $greeting ;
    		$email_message .=  $message ;
    		$email_message .= "\r\n\r\n--";
    		$email_message .= "\r\n" .  $signature->honorific . " " . $signature->first_name . ' ' . $signature->last_name ;
    		$email_message .= "\r\n" . $signature->email;
    		$email_message .= self::format_address( $signature );
    		$email_message .= "\r\n\r\n" .  $footer ;

    but still having the mail message not in html.

    Thank you for your support,
    Lorenzo

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Email doesn’t support html format’ is closed to new replies.