Why after the end of my mail there is some additional HTML?

ke.norb,

Your account at Kids has been activated.

You may now log in by clicking on this link or copying and pasting it in
your browser:
/user/reset/57/1234531155/97b4cb1cdd19c7eb7...
This is a one-time login, so it can be used only once.

After logging in, you will be redirected to
/user/57/edit so you can change your
password.

Once you have set your own password, you will be able to log in to
/user in the future using: username:
ke.norb

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">




cellpadding="0" cellspacing="0">
cellspacing="0">
CommentFileSizeAuthor
#5 simplenews_template.module.patch780 byteskenorb
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jerdavis’s picture

Status: Active » Postponed (maintainer needs more info)

I'm unable to reproduce, but there have been a few changes that could impact this. Please try the latest snapshot and see if that corrects the issue.

Jer

kenorb’s picture

It happen as well with latest snapshot.
I'll try to debug it later.

kenorb’s picture

Status: Postponed (maintainer needs more info) » Closed (duplicate)
kenorb’s picture

Project: Mime Mail » Simplenews Template
Category: support » bug
Status: Closed (duplicate) » Active

It's the same problem, but for different branch.
So the fix should be different.

kenorb’s picture

kenorb’s picture

Status: Active » Needs review
sersim’s picture

This issue can also be fixed changing line 39 (simplenews_template_mail_alter()) in this way:

  } else if (!$processed and substr($message['id'], 0, 11) == 'simplenews_') {
ron_s’s picture

I tried to use the patch in #5, and did not fix the problem. Here is the email I received when attempting to use the basic Drupal contact form (Mime Mail HTML not used for system messages):

admin sent a message using the contact form at http://www.testsite.com/contact.

Another test message

Another line 2

Another line 3

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>: </title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css">
<!--

-->
</style>
</head>
<body bgcolor="#ffffff">
<table class="simplenews-template-background" width="100%" bgcolor="#ffffff" cellpadding="0" cellspacing="0"><tr><td valign="top" align="center">
<table class="simplenews-template-content" width="100%" cellpadding="0" cellspacing="0"><tr><td align="left">

</td></tr></table>
</td></tr></table>
</body>
</html>
kenorb’s picture

If you saying that 'Mime Mail HTML not used for system messages', so that probably means he is.
#456260: WSOD: smtp_library variable is not removed when mimemail has been disabled
Even you will disable Mimemail, it will be still sending through Mimemail;)

Did you tried #7 as well?

There is duplicate: #345246: Two opening body tags but for 5.x

I don't remember how I solve that, but there is patch for 5.x that solved this problem on 5.x
http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/simplenews_...

franz’s picture

@kenorb

The patch has to be converted to unix format (dos2unix)

franz’s picture

... after which, it seems to work =)

franz’s picture

Status: Needs review » Fixed

commited on dev.

hanoii’s picture

Status: Fixed » Needs work

I don't think this patch is right, has anybody actually confirms this doesn't break the actual module. I just upgraded to beta3 to try out the latest changes on the module and the template from simplenews_template haven't kicked in at all.

I think the code introduced by this patch is actually making the theme function not to be executed properly, as it mainly will make the body of the mail almost never be processed. When is $message['body'] is going to be null?

I think that the solution for the actual problem in this issue might have been addressed by #567604: simplenews_template_mail_alter() is wrongly changing every mail and removing the first letter of plain text notifications, I will try to revert this patch and commit/comment on the behavior of the module

hanoii’s picture

Status: Needs work » Fixed

Well, I actually rolled back this patch from CVS, I am almost sure that has not to do with this problem or the duplicate issue. I have tested with simplenews+mimemail+simplenews_template and all seems working fine w/o the patch and not with it. If I am wrong and this is actually needed, please let me know and I'll follow this one further.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

roball’s picture

Title: some broken html code after the mail » Two <html> tags
Status: Closed (fixed) » Active

I am using the latest 6.x-1.x-dev version (2009-Nov-14), together with Simplenews 6.x-2.x-dev (2009-Dec-10) and Mime Mail 6.x-1.0-alpha1. The HTML part of the body of the mails sent by Simplenews looks like this:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html style="font-size:100%;">
<head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head>
<body bgcolor="#f2f7ec" style="background-color:#FFF;">
<table class="simplenews-template-background" width="100%" bgcolor="#f2f7ec" cellpadding="0" cellspacing="0" style="border-collapse:collapse;border-width:0px;font-size:1em;width:100%;margin:0010px0;"><tr style="border-spacing:0;border-collapse:collapse;border-width:0px;"><td valign="top" align="center" style="border-spacing:0;border-collapse:collapse;border-width:0px;">
<table class="simplenews-template-content" width="100%" cellpadding="0" cellspacing="0" style="border-collapse:collapse;border-width:0px;font-size:1em;width:100%;margin:0010px0;"><tr style="border-spacing:0;border-collapse:collapse;border-width:0px;"><td align="left" style="border-spacing:0;border-collapse:collapse;border-width:0px;">
<div class="simplenews-template-header">
This is the <strong>Header</strong>.
</div>
<div class="simplenews-template-body">
<h1 style="margin-bottom:0.3em;font-size:1.3em;">Test with Simplenews Template</h1>
<span class="print-link"></span><p style="margin-top:0.4em;margin-bottom:0.8em;">Dear Anonymous</p>
<p style="margin-top:0.4em;margin-bottom:0.8em;"><span style="text-decoration:  
underline;">xxx</span>:</p>
<ul style="margin:0;padding:0001em;">
<li style="line-height:1.6em;">1</li>
<li style="line-height:1.6em;">2</li>
</ul>
<p style="margin-top:0.4em;margin-bottom:0.8em;"><strong><span style="color: #ff0000;">ÄÄÄ bbbb</span></strong></p>
</div>
<div class="simplenews-template-footer">
<br>
--<br>
You are receiving this mail because you are subscribed to the newsletter<br>
"Test". If you no longer want to receive this newsletter,<br>
you can unsubscribe by clicking the following link:
</div>

</td></tr></table>
</td></tr></table>
</body>
<html style="font-size:100%;"><body style="background-color:#FFF;">
<p class="newsletter-footer" style="margin-top:0.4em;margin-bottom:0.8em;font-size:smaller;color:gray;"><a href="https://www.mydomain.tld/drupal/newsletter/confirm/remove/xxxxxxxxxxxxxxx" style="text-decoration:none;font-weight:bold;color:#B21F88;">Unsubscribe  
from this newsletter</a></p>

      
    
  </body></html>
</html>
hanoii’s picture

Have you override any theme function in your theme? Can you try the functionality with a default garland theme?
Thanks,
a.=

roball’s picture

No, I did not override a theme function. The problem also occurs with the default Garland theme:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head>
<body bgcolor="#f2f7ec" style="background:none;font:12px/170%Verdana,sans-serif;color:#000;width:640px;">
<table class="simplenews-template-background" width="100%" bgcolor="#f2f7ec" cellpadding="0" cellspacing="0" style="border-collapse:collapse;margin:1em0;width:100%;"><tr><td valign="top" align="center" style="padding:.3em.5em;">
<table class="simplenews-template-content" width="100%" cellpadding="0" cellspacing="0" style="border-collapse:collapse;margin:1em0;width:100%;"><tr><td align="left" style="padding:.3em.5em;">
<div class="simplenews-template-header">
<br>
This is the <strong>Header</strong>.
</div>
<div class="simplenews-template-body">
<h1 style="font-weight:normal;font-family:Helvetica,Arial,sans-serif;font-size:170%;">Test with Simplenews Template</h1>
<span class="print-link"></span><p style="margin:0.6em01.2em;padding:0;">Dear Anonymous</p>
<p style="margin:0.6em01.2em;padding:0;"><span style="text-decoration:  
underline;">xxx</span>:</p>
<ul style="margin:0.5em01em;">
<li>1</li>
<li>2</li>
</ul>
<p style="margin:0.6em01.2em;padding:0;"><strong><span style="color: #ff0000;">ÄÄÄ bbbb</span></strong></p>
</div>
<div class="simplenews-template-footer">
<br>
--<br>
© 2010, ISEKI-Food Association<br>
You are receiving this mail because you are subscribed to the newsletter<br>
"IFA eNews". If you no longer want to receive this newsletter,<br>
you can unsubscribe by clicking the following link:
</div>

</td></tr></table>
</td></tr></table>
</body>
<html><body style="background:none;font:12px/170%Verdana,sans-serif;color:#000;width:640px;">
<p class="newsletter-footer" style="margin:0.6em01.2em;font-size:smaller;color:gray;"><a href="https://www.mydomain.tld/drupal/newsletter/confirm/remove/xxxxxxxxxxxxxxx">Unsubscribe  
from this newsletter</a></p>

      
    
  </body></html>
</html>
roball’s picture

In the meantime, I have uninstalled the "Simplenews Template" module and now use the "simplenews-newsletter-body--[tid].tpl.php" and "simplenews-newsletter-footer--[tid].tpl.php" files directly from the "Simplenews" module. This solved the problem, so it seems to be caused by "Simplenews Template".

smk-ka’s picture

There is definitely something fishy going on when using the combination of simplenews, simplenews_template and mimemail. Both simplenews_template (during hook_mail_alter()) and mimemail (when finally sending the email in its drupal_mail_wrapper() implementation) wrap the email into a HTML structure, resulting in duplicated markup. I did only a short test, but eventually I disabled simplenews_template altogether and styled the email purely using mimemail's mimemail-message.tpl.php, which works if your email style may be applied to all outgoing emails (not just newsletters). However, some of the advanced features of simplenews_template, like preventing simplenews from inserting its title, are then not available.

I'm not sure what's the correct solution here, but since mimemail provides the HTML wrapping, I think simplenews_template should maybe avoid outputting its own markup scaffold.

An alternative solution might be simplenews_template still outputs full HTML and implements its own incarnation of mimemail_message.tpl.php based on mailkey, which simply passes the email through (i.e. to avoid adding markup again). But then again, it was only a short test.

webavant’s picture

theme_simplenews_template_content() is being called for me, and I confirmed because I was able to eliminate the

that is inserted in the module's function, but the tag is still inserted regardless that I removed it from my theme function. I imagine this has something to do with the way the theme engine works, but I just don't know.
kenorb’s picture

Issue summary: View changes
Status: Active » Closed (outdated)

Drupal 6 is no longer officially supported. If you think this issue is still relevant for 8.x, feel free to re-open.