I made a patch for enewsletter.module that implements a much-requested feature: previewing the newsletters before sending.

It adds two links below each newsletter's status in admin/enewsletters/newsletters: 'Plain text preview' and 'HTML preview'. Clicking on either of them will open a new browser window with the newsletter as it would be seen by a user who had checked all the allowed terms for that publication.

The patch is basically a replication of enewsletter_process_publications function, from which all references to a particular subscriber have been stripped. And, of course, the mail generation.

Remeber you must have created at least on new node in some of the categories that make the newsletter since the last time you sent it in order to see something.

This is the first time I submit a patch, so you're free to cick me in the ass if I did something wrong.
Robert, I hope you find it helpful...

CommentFileSizeAuthor
#1 enewsletter.module40.17 KBnbayaman
enewsletter_preview.patch7.76 KBsolaas

Comments

nbayaman’s picture

Category: feature » support
StatusFileSize
new40.17 KB

Good aproach. This is realy nececcary feature. But I have some troubles. I've applied the patch, links appeared, but they do nothing. The only open initial http://sitename/admin/enewsletters...

i attach the patched enewsletter.module

pfaocle’s picture

Category: support » feature
Status: Needs review » Needs work

Please don't change the issue category from feature/bug to support if you are either having trouble applying the patch, or the patch is broken, no good or just not up to scratch generally. Rather, leave the category as is, mark as 'patch (code needs work)' and explain the problems.

Back on topic, this looks like a great feature for an already brilliant and promising (albeit unfinished) module. +1 from me, and I'm going to take time looking into this one tomorrow. Thumbs up, all.

robert castelo’s picture

Sorry, haven't had time to look at this yet.

A preview facility is next on my list of features to implement.

There will be a preview on the template page, activated by a "preview" submit button.

Also, I'll have a "send email preview to:" field and "send preview" button, so we can see exactly what the message will look like.

robert castelo’s picture

The approach in the patch above is also good.

I think previewing templates with dummy data would be useful.

Also previewing actual newsletters is also neccessary.

robert castelo’s picture

Status: Needs work » Fixed

Implemented another approach, which is to send a preview email to users in a role.

Previewing in the browser was not that useful, the best place to preview is in email clients.

Status: Fixed » Closed (fixed)

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