Closed (won't fix)
Project:
HTML Mail
Version:
8.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
17 May 2011 at 12:55 UTC
Updated:
12 May 2023 at 18:17 UTC
Jump to comment: Most recent
Comments
Comment #1
pillarsdotnet commentedComment #2
blasthaus commentedFor example in Simplenews I'm using a simple drupal_set_message after the $body variable is built which just spits out the html as a message. This is very helpful for styling the message. Additionally it would be great to do something similar just after the emogrifier class does it's magic.
Comment #3
pillarsdotnet commentedThe way to do it would be to write a special
MailSystemInterfaceclass whose implementation of themail()method just captures the output for later viewing. Theformat()method would then callHTMLMailSystem::format().I could write the back-end code in fifteen minutes; the UI would take a bit longer. It's on my to-do list.
On the other hand, previewing in a browser is a poor indication of what the message will look like when viewed by the recipient mail program. A better way to do things would be to send a test newsletter to a test account and view the results that way.
Comment #4
blasthaus commentedGreat, yea I use litmus.com for testing btw. And just to be clear the drupal_set_message spits out raw html text which is good enough for me. that's where I can intercept the markup and copy/paste into a document to tweak the css. thanks huge!
Comment #5
greenskin commentedI need to implement a preview for my email message. I'm extremely new to Drupal 7's mail system. Can you quickly share a chunk of code for how I can render a preview?
Comment #6
blasthaus commentedwell like @pillarsdotnet said, what you may see in a preview on a webpage is not going to be an accurate preview for an email client. Above in comment #3, he describes how to go about this.
what i was after was essentially getting the full html code of the mail that gets sent. this may be possible to just use watchdog to send the html output as a string right before it gets sent via mail, so after you test it, you can look in the logs, copy and paste the html code into a text editor, save it and open in a web browser. it's cumbersome but should work.
fyi i ended up solving this pretty much outside of htmlmail entirely although i did use the echo module. it involved a custom module which was essentially a form where you create a newsletter by selecting nodes by content type and theme them with template files for various
<table>-based html markup like 1-row, 2-row, 3-row, 4-row which makes a summary for each node and uses imagecache for the different nodes' images. Note the full html markup was previously extensively tested in Litmus across all browsers. Then for the Drupal preview, I used an ajax callback on the form to generate a new pop-up page with the full html of the mail and the codefilter module to capture the html code in a text area to copy and paste into a bulk mail sender. (wow, that was a mouthful!) probably not something you want to try but it works :-)Comment #7
anybody+1 for this idea. We'd need the same for some quick checks.
Comment #8
tr commentedNew features need to go into the current version (8.x-3.x) first. If you would like to see this feature implemented, please provide a patch - the maintainers of this module will not be working on this.
Comment #9
tr commentedPlease see #3339287: The future of the HTML Mail module