New Drupal 6 release of Simplenews Template

jeffsensat - April 7, 2008 - 12:11
Project:Simplenews Template
Version:6.x-1.x-dev
Component:Code
Category:task
Priority:normal
Assigned:Unassigned
Status:closed
Description

I was just wondering if migration to and integration with Simplenews on Drupal 6 is on the roadmap.

#1

TBarregren - April 7, 2008 - 12:25

It's definitely on the road map. But I will probably not have time for it before summer (if not a customer of us request it before that).

#2

enzipher - October 2, 2008 - 19:37

Just want to check the progress of this issue. Any planned updates?

Thanks,

#3

NikLP - October 2, 2008 - 20:13
Title:Drupal 6 Integration» Port Simplenews Template do Drupal 6
Category:feature request» task

#4

pht3k - October 4, 2008 - 05:44

subscribing!

#5

bloke_zero - October 7, 2008 - 09:48

subscribing too!

#6

muhleder - October 23, 2008 - 22:15
Version:5.x-1.1» 5.x-1.2
Status:active» needs work

Here's a first rough stab at a port for D6 from the 5.x-1.2 version.

The main thing is that the per newsletter CSS is not working after changes to Simplenews. You can include a single mail.css file from your theme folder if you add some code to your template.php.

/**
*  Override mimemail message theme so that mail.css is
*  called from this theme folder rather than the module folder.
*/
function phptemplate_simplenews_template_mimemail_message($body) {
  return theme_mimemail_message($body);
}

The emogrify feature is not working either, though that is possibly fixable. I couldn't see a way to get the per newsletter CSS working though.

AttachmentSize
simplenews_template-D6.zip 20.04 KB

#7

Babalu - October 31, 2008 - 18:07

subscribing

#8

thomasmuirhead - November 2, 2008 - 10:40

subscribing

#9

checker - November 7, 2008 - 13:27

subscribing

#10

jorgemare - November 14, 2008 - 06:50

Subscribing

#11

blackdog - November 18, 2008 - 15:58

Here's an updated work based on #6, patched against 5.x-1.2.

Not working yet:

* Menu / preview of newsletters
* Actually adding the template stuff to a newsletter, needs to work with hook_mail_alter I think

Changed from #6

* Re-worked the form_alter to work, added a submit function and moved around some code to make it smaller and more readable.

Patch adds a couple of files that were in #6 but not in 5.x-1.2, and also moves translations to a new folder.

AttachmentSize
simplenews_template_d6_port.patch 59.16 KB

#12

blackdog - November 18, 2008 - 16:00

And here's a .zip for those who likes that better...

AttachmentSize
simplenews_template.zip 17.26 KB

#13

blackdog - November 19, 2008 - 11:08

Updated patch that actually works. You have to use the latest Simplenews -dev to work with Mimemail.

E-mails sent out has the header and footer you set. If you have a mail.css in your theme folder and a small template function in your template.php (see README.txt) those styles will get included.

Not tried the emogrifier stuff.

Feels like we should get this in to a 6.x-dev soon so more people could try it out...

Not sure why muhleder deleted the help texts in his version, I'll add them back later.

Docs needs updating to.

AttachmentSize
simplenews_template_d6_port.patch 50.74 KB

#14

muhleder - November 21, 2008 - 10:43

Hiya,

I'm not sure why I deleted them either..

I used the deadwood module to do the initial work so that might have skipped them? There were also a load of comments in the code which I thought had been inserted by deadwood, so I stripped them out just to read the actual code a bit easier.

#15

fairwind@drupal.ru - November 24, 2008 - 04:47

Patch in #13 does not applied clean against 5.x-1.2:

patching file simplenews_template/CHANGELOG.txt
The next patch would create the file simplenews_template/README.txt,
which already exists!  Assume -R? [n]
Apply anyway? [n]
Skipping patch.
1 out of 1 hunk ignored -- saving rejects to file simplenews_template/README.txt.rej
patching file simplenews_template/simplenews_template.info
Hunk #1 FAILED at 1.
1 out of 1 hunk FAILED -- saving rejects to file simplenews_template/simplenews_template.info.rej
patching file simplenews_template/simplenews_template.install
Hunk #1 FAILED at 1.
1 out of 1 hunk FAILED -- saving rejects to file simplenews_template/simplenews_template.install.rej
patching file simplenews_template/simplenews_template.module
Hunk #1 FAILED at 1.
Hunk #2 FAILED at 83.
Hunk #3 FAILED at 103.
Hunk #4 FAILED at 142.
Hunk #5 FAILED at 244.
Hunk #6 FAILED at 309.
Hunk #7 FAILED at 432.
7 out of 7 hunks FAILED -- saving rejects to file simplenews_template/simplenews_template.module.rej
The next patch would create the file simplenews_template/translations/fr.po,
which already exists!  Assume -R? [n]
Apply anyway? [n]
Skipping patch.
1 out of 1 hunk ignored -- saving rejects to file simplenews_template/translations/fr.po.rej
The next patch would create the file simplenews_template/translations/no.po,
which already exists!  Assume -R? [n]
Apply anyway? [n]
Skipping patch.
1 out of 1 hunk ignored -- saving rejects to file simplenews_template/translations/no.po.rej
The next patch would create the file simplenews_template/translations/simplenews_template.pot,
which already exists!  Assume -R? [n]
Apply anyway? [n]
Skipping patch.
1 out of 1 hunk ignored -- saving rejects to file simplenews_template/translations/simplenews_template.pot.rej

Looking into patch, seems it createn against 5.x-1.1:
diff -urp -N simplenews_template_5/simplenews_template.info simplenews_template/simplenews_template.info
--- simplenews_template_5/simplenews_template.info 2007-04-10 00:00:24.000000000 +0200
+++ simplenews_template/simplenews_template.info 2008-11-19 11:58:55.000000000 +0100
@@ -1,9 +1,14 @@
-; $Id: simplenews_template.info,v 1.1 2007/03/22 20:27:54 tbarregren Exp $
-name = "Simplenews Template"
-description = "Extends Simplenews by providing a themable template with configurable header, footer and style."
-version = "$Name: DRUPAL-5--1-1 $"
-dependencies = simplenews mimemail
-; Information added by drupal.org packaging script on 2007-04-09
-version = "5.x-1.1"

(last line?!)
Patch applied more cleanly to 5.x-1.1, but not works :(

#16

fairwind@drupal.ru - November 24, 2008 - 07:01

Adding header and footer work only for 'simplenews' node type because of hardcoded 'if' here:

function simplenews_template_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {
  if ($node->type == 'simplenews') {
    $function = "_simplenews_template_node_$op";
    if (function_exists($function)) {
      return $function($node, $a3, $a4);
    }
  }
}

Adding header &footer in _view op seems incorrect because header & footer visible in standart node view. So cool simplenews feature transforming any node type to news become unusable :( Sorry, i have not enought skills for fix that.

One more thing: enabling simplenews_template leading to white screen of death on many administrative pages...

#17

mrfelton - November 25, 2008 - 14:13

subscribing

#18

trophaeum - December 3, 2008 - 17:38

subscribing

#19

tobiassjosten - December 4, 2008 - 12:45
Title:Port Simplenews Template do Drupal 6» Port Simplenews Template to Drupal 6
Assigned to:Anonymous» tobiassjosten
Status:needs work» active

I have a working port up and running but am still ironing out a few quirks, which I hope to have fixed this week.

#20

tobiassjosten - December 5, 2008 - 14:01

A beta release for Drupal 6 is out! Except for the Emogrifier integration, which I am looking at next, it should be a fully working port. Feel free to correct me on that if you find that I'm wrong.

#22

TBarregren - January 31, 2009 - 20:59
Version:5.x-1.2» 6.x-1.0-beta2

I've rolled a new beta with that applies the patch in #28 of #346264: Missing argument 3 for _simplenews_template_theme_simplenews_newsletter_body in simplenews_template.module on line 370.

Unfortunately, I haven't had time to until now to take a look at the port from D5 to D6. Doing that, I've noticed that there are several things that still requires attention from tobiassjosten or me. In addition, I've fixed some problems and added features to the new 5.x-1.3 release. These must also be incorporated. Taken together I must say that this release, labeled as a beta, actually is an alpha release. But I am afraid that changing the tag from beta to alpha would be to confusing, so I decided to stick with the beta label. But please, bear in mind that this actually is an alpha release.

#23

TBarregren - February 2, 2009 - 22:40

I've added several new features to Simplenews Template 5.x-1.4-BETA2 as well as fixed some issues. With these done, it is my intention to now focus on the 6.x port together with tobiassjosten.

#24

kelvincool - February 5, 2009 - 15:41

Hello,

With beta2, I couldn't see any headers or footers. I figured this out and have created a patch, I think it only happens when you have more than one newsletter series. Hope it helps someone.

kelvin,
Orange Bus

AttachmentSize
simplenews_template.patch 1.11 KB

#25

spidersilk - February 16, 2009 - 07:35

Subscribing.

#26

WalterC - February 24, 2009 - 19:10

Subscribing.

#27

jfraser - March 4, 2009 - 04:11

subscribing

#28

mdowsett - March 5, 2009 - 21:46

i tried the latest version of this module along with these related modules:
Simplenews 6.x-1.0-rc5
Simplenews on register 6.x-1.0
Simplenews Statistics 6.x-1.1
Mime Mail 6.x-1.x-dev

And now when I send a test newsletter, I get a white screen - no errors. I disable the Template module and the newsletters go out OK. And the log doesn't show any errors.

I'm not sure where to go to help fix this but I thought I should report my findings.

#29

muhleder - March 6, 2009 - 00:10

If you can take a look at the php error log you should be able to see which particular line of code is causing the crash. You can also set php to print errors to the screen which should give you the same information, though you wouldn't want to have that enabled on a production server.

#30

joostvdl - March 6, 2009 - 15:40

Subscribing

#31

kenorb - March 17, 2009 - 11:23

This patch should be implemented as well:
#345246: Two opening body tags
http://drupal.org/cvs?commit=168052

#32

tobiassjosten - March 17, 2009 - 11:41
Assigned to:tobiassjosten» Anonymous

I apologize fo my lack of update on this issue. What seems to be the current "problem" is that Simplenews and Mime mail for D6 apparently provides quite a bit of what Simplenews template used to handle - namely templates and CSS immersion. This is great stuff of course but it begs the question of what role Simplenews template should fulfill in the future. Me and Thomas have been discussing this and come to the conclusion that since the body and footer additions are still not provided by Simplenews, that should still go in this module.

Because I never seem to get enough free time to make this happen, and I don't want to have it look like I am actually working on this so others might hold off, I will go ahead and unassign me from the issue.

#33

ikarusweb - April 1, 2009 - 14:36

Subscribing

#34

miiimooo - April 15, 2009 - 13:17

subscribing

#35

miiimooo - April 15, 2009 - 15:24

Woohoo! Works very well - even with FCKEditor using images - downloaded the beta2 and applied patch above. Thanks you guys.

#36

mlieshout - May 5, 2009 - 06:16

Subscribing

#37

tobiberlin - May 21, 2009 - 11:24

subscribing

#38

kenorb - July 30, 2009 - 11:05

For those who want simpler way to make a header and footer without any module (only yours), try this:

<?php
/**
* Implementation of hook_mail_alter().
*
*/
function foo_mail_alter(&$message) {
 
 
$msg_id = $message['id']; // get Message ID

  /* detect mail body format */
 
if (is_array($message['body'])) {
     
$body = &$message['body'][0];
  } else {
     
$body = &$message['body'];
  }

 
/* set header and footer */
 
$header = theme('foo_mail_header');
 
$footer = theme('foo_mail_signature');

 
/* check Message ID and prepare body to sent */
 
switch ($msg_id) {     
      case
'simplenews_node':
      case
'simplenews_test':
         
$body = $header . $body . $footer;
          break;
      default:
// other mails
         
$body = $header . $body . $footer;
         
watchdog ('mail', "Mail sent with ID: " . $msg_id); // log for testing purposes
 
}
}

/**
* Implementation of hook_theme().
*/
function foo_theme() {
  return array(
   
'foo_mail_header' => array(
     
'arguments' => array(),
     
'file' => 'foo.theme.inc',
    ),
   
'foo_mail_signature' => array(
     
'arguments' => array(),
     
'file' => 'foo.theme.inc',
    ),
  );
}
?>

And in foo.theme.inc file you should define functions: theme_foo_mail_header() and theme_foo_mail_signature() like:

<?php
/**
* theme function for mail header
*/
function theme_foo_mail_header($user = NULL) {
    global
$user;
    return !empty(
$user->picture) ? "<center><img src='$user->picture'></center>\n\n" : '';
}

/**
* theme function for mail signature
*/
function theme_foo_mail_signature($user = NULL) {
    global
$user;
    return !empty(
$user->signature) ? "\n\n--\n$user->signature" : '';
}
?>

Don't forget to clear the cache, to rescan theme files.

#39

kenorb - May 21, 2009 - 15:37

Or try this alternative:
http://drupal.org/project/mail_header

Because this module should be simple, so I don't know why there is so many bugs in simple functionality which should provides header and footer.
After long time of using it, patching and patching, I've decided to remove this module and put above functions in my module - work perfectly.

In my opinion at least there should be something committed for core 6.x to make some order (last commit for 6.x is from January).
May people don't know about that, because it's not even listed. And there are too many patches to many version.
Or please give me cvs permission, I'll commit latest 6.x version, and then this thread should be closed after 1 year.

#40

adamo - May 22, 2009 - 18:32

@kenorb: Thanks for that. I'd really like to see an official 6.x release of this module, but if that doesn't happen any time soon it looks like I'll be able to get what I need from the code you posted.

#41

SocialNicheGuru - June 5, 2009 - 12:41

is there anyway to use panels to format the newsletter and then email the newsletter using simplenews?

Chris

#42

NikLP - June 5, 2009 - 12:58

That sounds pretty adventurous! :O I don't know, but I guess it would be possible. Doesn't sound easy tho! :/

#43

SocialNicheGuru - June 9, 2009 - 23:10

Is there a tutorial on how to create a newsletter using simplenews? Is there a use case?

i haven't found one and I don't have a clue on where to start.

#44

eff_shaped - June 12, 2009 - 12:02

subscribing

#45

guaka - June 17, 2009 - 22:07

subscribing

#46

perke - June 26, 2009 - 12:06

subscribing

#47

twirlingsky - July 10, 2009 - 00:24

Subscribing

#48

muhleder - July 10, 2009 - 11:59

For what it's worth, I've just updated a Drupal 5 site to Drupal 6, with simplenews and simplenews_template modules. This port of template isn't really working tbh and you can get headers and footers using the template files now provided inthe simplenews module. They have to be stored as files in your theme folder rather than being configurable from the admin interface, but personally this works better for me.

Given that the functionality of Simplenews Template is now provided by Simplenews itself, I think it's very unlikely that anyone's going to do the work to get this module working. Should maybe mark this module as abandoned for D6?

#49

RAFA3L - July 11, 2009 - 12:32

subscribing

#50

Delta Bridges - July 14, 2009 - 16:37

Well not really.... I was using Simplenews template not for the header and footer but fotr the white background it can provide.
I had on D5 ( and still have on D6) a bug where a colored background would automatically be added to the emails sent making it difficult for my users to read, especially the links.
So I would be happy if this module was still maintained for D6 :)

#51

muhleder - July 15, 2009 - 00:04

Well... you could open a div or table (with a white background) in the header and close it in the footer with the templates in simplenews. Prob better off fixing the bug if you can though.

The thing is that anyone who would be able to update the module, would prob find the templates a better option, so imo unlikely that it's going to happen.

#52

Delta Bridges - July 15, 2009 - 15:38

I am not very good at dealing with templates myself... but I done the table trick and it has work... thanks for the tip :)

#53

peashooter - July 17, 2009 - 17:31

But can you override the style.css from your theme with simplenews theming?

I want to find a way to replace my massive style.css file from being attached to all my mimemail mails...

#54

muhleder - July 18, 2009 - 08:34

You can, but from memory it's mimemail that is responsible for putting the css file into the newsletter. I've got mimemail_message.tpl.php in my theme folder (can be within sub directory), which contains the code below for me.

You can see that it gives you full control over the newsletter output. The text version of the newsletter is auto-generated from the resulting html (again from memory, but pretty sure that's correct).

The $body variable gets generated by simplenews, and should include the header and footer templates.

<?php
// $Id: mimemail.tpl.php,v 1.1.2.2 2009/04/14 23:09:01 jerdavis Exp $

/**
* @file mimemail.tpl.php
*/
?>

<html>
  <head>
    <meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
      <style type='text/css'>
        td#saw-newsletter-footer a:visited,
        td#saw-newsletter-footer a:link  {
          text-decoration:none;
          color:#007BBF;
        }
        table h1,
        table h2,
        table h3,
        table h4,
        table h5,
        table h6 {
          color:#007BBF;
        }
        p {
          margin-top:10px;
          margin-bottom:10px;
        }
      </style>
    </meta>
  </head>
  <body style='padding:0;margin:0;'>
    <table style='font-family:Helvetica; font-size:12px;' align='center' bgcolor='#dddddd' width='100%' height='100%' cellpadding='0' cellspacing='0'>
      <tr>
        <td valign='top' align='center'>

          <?php print $body ?>
         
        </td>
      </tr>
    </table>
  </body>
</html>

#55

peashooter - July 18, 2009 - 08:49

muhleder, thanks so much for that really appreciate it.

#56

geerlingguy - July 26, 2009 - 20:50

Sub - can't test yet, but will be working on a client's site in a few weeks which will require this module. I'll help as much as I can!

#57

joachim - July 30, 2009 - 10:43

> For what it's worth, I've just updated a Drupal 5 site to Drupal 6, with simplenews and simplenews_template modules. This port of template isn't really working tbh and you can get headers and footers using the template files now provided inthe simplenews module. They have to be stored as files in your theme folder rather than being configurable from the admin interface, but personally this works better for me.

Downside is you can't let end-users configure their newsletters -- eg site editor wants to change the header message on their organization's newsletter.
I think there's still a case for this module.

#58

muhleder - August 3, 2009 - 07:27

"Downside is you can't let end-users configure their newsletters -- eg site editor wants to change the header message on their organization's newsletter.
I think there's still a case for this module."

That's very true, but you could provide that sort of functionality using a little bit of custom code and the simplenews template files. Would think you could use hook_form_alter to add a signature field to each node edit page of type simplenews, then save that as a variable keyed to the term id. (So you get a unique signature for each newsletter). Then add that variable to the simplenews template file.

Would be better as a self contained module, but imo simplenews has changed so much you might be better off writing something like that from scratch rather than continuing the port of the D5 simplenews template module. Seems like people have been finding quite a few problems with it.

#59

joachim - August 3, 2009 - 07:37

Right, so let's make the D6 version of this module match up to Simplenews D6. What's the point in registering a new module name when this one is a fair description?

Looking at the documentation page for this module, the D5 version did 3 things:
- provide an admin UI for per-newsletter header and footer
- provide a phptemplate template file
- emogrifier

We keep 1, ditch 2 because simplenews does it now, and I've no idea about 3.

Are the maintainers of this module still around?

#60

TBarregren - August 3, 2009 - 07:48

@joachim:
Maintainer here. :-) I think that is he way to go: keep 1 and ditch 2. Regarding 3, the MimeMail Compress module, bundled with MimeMail, is a ripoff of Emogrifier, so it could probably also be ditched.

#61

joachim - August 4, 2009 - 21:32

@TBarregren: I need this module for a project fairly soon, so I'm very interested in getting a proper release for D6. How can I help with this?

#62

guix - August 11, 2009 - 23:59

There are patches for the HTML Mail module too for Emogrifer : http://drupal.org/node/489960#comment-1913454

#63

hanoii - September 3, 2009 - 18:09

As joachim, I am currently using the module and also might be able to help, what's the status of the module, still maintained? abandoned? Is there room for contributing in a more active way than submitting patches into the queue? Maybe consider co-maintainers?

#64

franz.glauber - September 28, 2009 - 17:38

I tested the patch from #24 and it seems to be working.

#65

franz - October 9, 2009 - 15:43

What is still missing before we can release a 6.x version?

#66

wOOge - October 20, 2009 - 13:36

Subscribing

#67

bgogoi - October 25, 2009 - 07:31

Hi, This is almost end of 2009!

Can the alpha released be updated and released with latest updated, if any??

Thanks a lot for your attention.
==============================================
Official release from CVS tag: DRUPAL-6--1-0-BETA2
First released: January 31, 2009 - 20:35
Download: simplenews_template-6.x-1.0-beta2.tar.gz
Size: 12.88 KB
md5_file hash: 0881a4ef6f1992f0b305eef94b04520c
Last updated: January 31, 2009 - 20:40
==============================================

#68

franz - November 5, 2009 - 16:07
Title:Port Simplenews Template to Drupal 6» New Drupal 6 release
Version:6.x-1.0-beta2» 6.x-1.x-dev

Ok, all co-maintainers, what's the roadmap? This module really need a release. I'll try to work on critical bugs from here.

Please, try to finish bugs assigned to you.

I'll get these:

#609442: Site CSS in HTML mail header
#373915: some broken html code after the mail
#605212: Tokenize the header and footer
#391874: FYI: Some remarks about the html

Will update the status here, hope we can have at least a beta3 launched and minimally supported.

#69

mrfelton - November 5, 2009 - 17:10
Title:New Drupal 6 release» New Drupal 6 release of Simplenews Template

Updating title so that I can identify the issue in my tracker.

#70

franz - November 5, 2009 - 19:50

Up to go, there are only a few major bugs left.

#71

Delta Bridges - November 7, 2009 - 09:20

Thanks a lot Franz :)

#72

franz - November 11, 2009 - 17:15
Status:active» fixed

All bugs currently fixed!

Beta3 out of the oven on the next minutes

#73

geerlingguy - November 11, 2009 - 17:25

Great! Thanks for your work on this. I'll be testing over the next few weeks, as I'm going to be using this on two separate sites.

#74

System Message - November 25, 2009 - 17:30
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.