Home › Forums › Front End PM PRO › About email beautifying
- This topic has 10 replies, 3 voices, and was last updated 7 years, 10 months ago by Shamim Hasan.
-
AuthorPosts
-
January 11, 2017 at 10:41 am #2242Edi MichaelParticipant
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?January 11, 2017 at 1:00 pm #2250Shamim HasanKeymasterPlease 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.
January 11, 2017 at 2:27 pm #2252Edi MichaelParticipantHi,
In fact I did stay in ‘text’ tab, but the code is still changed after I clicked ‘save settings’ .January 11, 2017 at 10:45 pm #2255Shamim HasanKeymasterPlease give me admin access to your website.
Full backup your website before giving me admin accessJanuary 31, 2017 at 12:44 am #2580Tavan EftekharParticipantHi 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?
February 1, 2017 at 5:31 am #2623Tavan EftekharParticipantHere 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”>
<html xmlns=”http://www.w3.org/1999/xhtml” 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>February 1, 2017 at 10:43 pm #2639Shamim HasanKeymasterfor 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)
February 2, 2017 at 12:25 am #2647Tavan EftekharParticipantThank 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
February 2, 2017 at 12:52 am #2650Tavan EftekharParticipantI 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!
TavanFebruary 2, 2017 at 1:04 am #2653Tavan EftekharParticipantI 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,
TavanFebruary 4, 2017 at 10:49 pm #2698Shamim HasanKeymasteryou can use stripslashes() there.
I will investigate more and try to fix this in next version. -
AuthorPosts
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.