Hello
I'm having a problem when sending HTML emails.
The emails are being recieved with strange vertical spacing everywhere... Is this something to do with wordpress parsing the code and inserting stuff?
Aaron
Hello
I'm having a problem when sending HTML emails.
The emails are being recieved with strange vertical spacing everywhere... Is this something to do with wordpress parsing the code and inserting stuff?
Aaron
It seems that wordpress (im using version 3.0) adds <br>'s for no apparent reason when there is a table? I could be wrong but my simple email:
<table width="80%">
<tr>
<td align="left">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</td>
<td align="right"><img src="image-src" /></td>
</tr>
</table>
Ended up with about 10 <br>'s before it... Any idea why?
Hi Aaron. I don't know why... It could be the WP parser. Did you tried to view the message with different email clients? They influence the html rendering.
Yeh I viewed from Horde, SquirrelMail, Live Mail, Thunderbird, iPhone email client, etc.
It only happens when I add a table. When I view the source of the page in a webmail client, the <br>'s aren't there, I can only view them in FireBug... There seems to be 6 of them. :/
Ok, maybe I understood. As we know the rich editor is not very accurate. It adds a <br> for each code line... so it adds 6 <br> for your html code and the e-mail client shows them before the table.
I've tried to send a newsletter with a table written without breakline, eg:
<table width="80%"><tr><td align="left">Lorem ipsum ......</td><td align="right"><img src="image-src" /></td></tr></table>
and it seems to not add <br>.
Ok il experiment with that but im pretty sure I tried that...
Thanks for the help (i'll be back once I get stuck again! ;))
The same her with the tables. I needed a simple table to get a fixed width for the newsletter.
There are everywhere breaks at the beginning of the table codes.
But there is a solution. In the alo-easymail_functions.php on line 492 there is a code:
$updated_content = str_replace( "\n", "< br / >", $updated_content);
this code is necessary for line breaks(shift+enter) in the text.
It seems that the Wordpress editor also put \n breaks at the beginning of the table codes.
A workaround is to put after the code these two lines:
$updated_content = str_replace( "< br / ><t", "<t", $updated_content);
$updated_content = str_replace( "< br / ></t", "</t", $updated_content);
This delete the unwanted breaks in the table.
Here it works.
NB: In the code above there are some spaces to post it here, not in the original code
Hi Gunu,
Why don't you use div tags instead of table tags?
Hello APPB,
this doesn't work nice in de Wordpress editor. People have to double click to get in the div tags to type there message.
Gunu, thank you for the easy workaround to clean the line breaks, I'll keep in mind.
I am really interested in Gunu's solution but didn't see $updated_content = str_replace( "\n", "< br / >", $updated_content); at line 492 in alo-easymail_functions.php file, but find in alo-easymail_main.php at line 149 and see that this one already included in the code. So i don't need to hack the code myself, great. But!
But i still have problems related to unwanted (extra) linebreaks. Here is a part of my template:
<table style="width: 600px;" cellspacing="0" cellpadding="20" bgcolor="#ffffff">
<tbody>
<tr>
<td valign="top" bgcolor="#ffffff">
<h6>Year, Issue, Date</h6>
<h3>Title</h3>
Text
In the arrived email i see this:
<h6>Year, Issue, Date</h6>
<h3>Title</h3>
Text
These breaks ruin the newsletter so i would like to eliminate them somehow. I thought that Gunu's trick is created for this purpose (BRs created when using TABLEs), but seems my situation is somehow different. Is there anybody here with the knowledge to recognize where is the problem?
Uhh sorry, but the above letter doesn't contain the most important part. Correctly in the arrived email i see this (and this is the problem):
<h6>Year, Issue, Date</h6>
<h3>Title</h3>
Text
My solution: adding more similar lines to the code, like this:
$updated_content = str_replace( "<h", "<h", $updated_content);
and this way i killed the unwanted BRs before header tags.
OK, this doesn' work. There are line break tags before H6 and H3 and i removed them with the same method suggested by Gunu previously.
Hello,
This plugin is just great, simple and do what it is suppose to do with just enough possibility.
But ...
I am stuck with this /BR trouble. I have try to modify the $updated_content = str_replace( "\n", "< br / > code about every where in alo-easymai..php, but it seems it doesn't do anything but adding those annoying /br line.
I have try html code and no html code in newsletter, table, table into table, ... .Still the same !
I not an expert on architecture of Wordpress&Aloeasymail and what happens when I validate sending an email (in order what xxx.php are used), same, I don't know if other plugins can bypass the alo-easymail patch and keep those xxxx /br.
This is really too bad because with this I just can use it.
Any clues ? Any Idea for me to check/debug ...
Many thanks for you help
alo,
Thanks for your suggestion from a few months back. I just tried to send a newsletter with a table written without breakline and it works much better.
The rendering in the Firefox 2.0 email client was a mess until I got rid of the breaklines. Now it renders OK.
Of course, it is now more difficult for me to read and edit the HTML...
I was about to give up on this plugin until I read this post so thanks. I just wanted to send HTML newsletters which was basically impossible unless you do two things.
1. disable the visual editor for the user sending the newsletter
2. comment out the line in alo-easymail_main that says:
$updated_content = str_replace("\n", "<br />", $updated_content);
Now it works great. I create the HTML file offline, preview in browser and then cut and paste into the Newsletter.
Two features that I think I'll work on are:
1. Create a "Preview Newsletter" link under the editor box
2. Create meta-tags that will insert common HTML newsletter code like [insert_header], etc.
Nice plug-in though, thanks for all the work done on it.
Just updated to version 1.8.7, and even after commenting out lines 173-176, my HTML still wasn't showing up properly.
I discovered that some filters were still being applied in line 139 of alo-easymail_main.php.
if ( get_option('ALO_em_filter_the_content') != "no" ) $main_content = apply_filters('the_content', $main_content);
Commenting that out seemed to fix the issue. Just letting everyone else know about it.
You can set up some filter options in newsletter settings in admin panel (Settings → Newsletter → tab General). They should work, please test them.
The reason I had to disable the filter is because after I had un-checked the box to convert returns to breaks and hit Update, the box was still checked.
Active plugins include:
Hey, you found a bug in v.1.8.7, many thanks :)
To make checkboxes work you can add this code after line 93 of alo-easymail_option.php:
if ( isset($_POST['filter_br']) ) {
update_option('ALO_em_filter_br', "yes");
} else {
update_option('ALO_em_filter_br', "no") ;
}
if ( isset($_POST['filter_the_content']) ) {
update_option('ALO_em_filter_the_content', "yes");
} else {
update_option('ALO_em_filter_the_content', "no") ;
}
I'll fix in next version.
You must log in to post.