About email beautifying


Home Forums Front End PM PRO About email beautifying

This topic is: Not Resolved
Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #2242
    Edi Michael
    Participant

    Hi,
    I’m trying to make html templates for the email notification, but the html template I pasted was changed after I save the setttings. Seems all the <html> and <style> tags are sanitized by the editor, I did set the Email Content Type to html, and the editor was in text mode, not visual mode.
    Is there any way to preserve all the contents I pasted?

    #2250
    shamim
    Keymaster

    Please do not change between “Text” and “Visual” tab. it will preserve all your code. Keep in “Text” tab and add your code then save. then send a message and see your email.

    #2252
    Edi Michael
    Participant

    Hi,
    In fact I did stay in ‘text’ tab, but the code is still changed after I clicked ‘save settings’ .

    #2255
    shamim
    Keymaster

    Please give me admin access to your website.
    Full backup your website before giving me admin access

    #2580
    Tavan Eftekhar
    Participant

    Hi I’m having this same issue, when I add my code in Text and then click save, it removes all of my css style tags. Any solution?

    #2623
    Tavan Eftekhar
    Participant

    Here is a sample of the type of HTML I am trying to use. The html and style tags seem to get removed when I click save:

    <!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”&gt;
    <html xmlns=”http://www.w3.org/1999/xhtml&#8221; dir=”ltr”>
    <head>
    <meta name=”viewport” content=”width=device-width”>
    <meta http-equiv=”Content-Type” content=”text/html; charset=UTF-8″>
    <title>Northwestern Medical Review</title>
    <style type=”text/css”>@media only screen and (max-width: 640px) {

    h1 {
    font-size: 18px !important;
    }
    h2 {
    font-size: 16px !important;
    }
    h3 {
    font-size: 14px !important;
    }
    .content {
    padding: 10px !important;
    }
    h1.content {
    padding: 0px !important;
    }
    .content-wrapper {
    padding: 10px !important;
    }
    .headlinks span {
    display: none;
    }
    .headlinks a {
    display: block !important;
    font-size: 11px !important;
    }
    }</style>
    </head>
    <body style=”font-family: ‘Arial’, Arial, Sans-Serif; box-sizing: border-box; font-size: 13px; -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: none; width: 100% !important; height: 100%; line-height: 1.6; background: #f5f5f5; margin: 0; padding: 0; background-color: #f5f5f5;”>

    </body>
    </html>

    #2639
    shamim
    Keymaster

    for security reasons wp_kses_post is used. So some code may strips out. If you want to keep as you type you need to change 2 lines of code in class-fepadmin-settings.php and remove wp_kses_post from line 444 and 512 ( fep version 4.8)

    #2647
    Tavan Eftekhar
    Participant

    Thank you for your reply.

    I will edit the file, but I’m having trouble finding the lines of code referenced. I have version 4.8.

    Just to compare, my class-fepadmin-settings.php file has 1533 lines.

    Line 444 is an empty line, and so is 512 (lots of double line spacing in the code file).

    I searched for the instances of wp_kses_post in the file (found 5 total) and found there are 4 in the function called field_output, and 1 in the function called posted_value_sanitize.

    Which of these instances should be modified or removed?

    Thank you!

    Tavan

    #2650
    Tavan Eftekhar
    Participant

    I went ahead and tested it deleted ALL 5 uses of the wp_kses_post function for now as I’m the only one using the admin system. It seems that I can finally get the HTML to store properly in the fep settings. But when I actually go to test an email notification, the email is showing up blank because all of the html has \’s in front of quotes and apostrophes.

    So for example, if my saved HTML shows as in my settings page… When I get an email that uses that HTML I get a blank email, then I check the code for that received email to see why it is blank, and I see it isn’t blank, but actually that it is trying to show me which results in nothing being shown.

    I imagine I need to strip the slashes somewhere but I don’t know how or where.

    How can I strip the slashes properly for when the emails are sent?

    Thanks!
    Tavan

    #2653
    Tavan Eftekhar
    Participant

    I tested it out myself by further editing the class-fep-email-beautify.php file as well.

    In the function filter_before_email_send, I added stripslashes( ) around the $content variables.

    This seems to have fixed all of my problems, but I’m not sure if I’ve left any big dangers by doing so. Is there any issue with using stripslashes() there?

    Thanks,
    Tavan

    #2698
    shamim
    Keymaster

    you can use stripslashes() there.
    I will investigate more and try to fix this in next version.

Viewing 11 posts - 1 through 11 (of 11 total)

You need to purchase ‘Front End PM PRO’ to create topic in this support forum.

If you already purchased ‘Front End PM PRO’ please LOGIN.