I thought I'd put this out there to see what you think.
When I first started using Subscriptions module, I tried to get it to work sending HTML email using the Mail Edit module (http://drupal.org/project/mail_edit) as described in your documentation, but failed. I couldn't get it to reliably use my template settings, etc. Well, to make a long story short(er) I gave up on Mail Edit and decided to try using Mime Mail module instead. (http://drupal.org/project/mimemail)
In order for this to work, however, I had to directly edit the file from your module, named subscriptions_mail.templates.inc, to match my theme. It works wonderfully, however, I do have fears that one day you may decide to change something in the file, in which case I'll have to re-engineer the thing again.
In light of this, I'm putting up this feature request to see if you could look into supporting a more generalized method on theming for Subscriptions emails. After installing Mime Mail, I've discovered that there are a lot of other modules that email from Drupal sites that seem to use a common method of editing simple themes for their output. In every case, I've been able to just enter in a text field the HTML for my theme to get them to output perfectly themed HTML emails (through the use of Mime Mail) straight from the UI of the modules.
Here are a couple that use a "Fill-in-the-text-area with a template and Tokens" approach to setting up email output formatting:
- Advanced User (http://drupal.org/project/advuser) notifies admin when a user modifies or creates their profile.
- Comment Mail (http://drupal.org/project/commentmail) notifies admin or moderator when a new comment is posted
- Modr8 (http://drupal.org/project/modr8) notifies admin of new content, and poster of said content when it is approved/denied
- Drupal User Settings (v6 Core) user welcome messages, email verifications, account activations/blocked/deleted notifications
These all use a plain text area, and provide a (sometimes long) list of "!xxxxx" style tokens that may be used in the text area for outgoing emails... sometimes there is one for each type of outgoing email. THIS is very useful.
My question is this: Could you provide some kind of setting like these modules do, for Subscriptions module, so one doesn't need to directly modify a core module file to get reliable HTML emails out? With tokens?
I'd also love to be able to have tokens available to place an ad from Advertisements Module (http://drupal.org/project/ad) into the email this way, or modify my template in a setting rather than hacking a file.
Attached is a sample of the file I've modified so you can see what I ended up doing to get my template to work. :-)
Making your module work in this way would make it possible to easily have HTML email using Mime Mail module instead of being subject to the quirks of Mail Edit module.
| Comment | File | Size | Author |
|---|---|---|---|
| subscriptions_mail.templates.inc_.zip | 3.05 KB | gregarios |
Comments
Comment #1
gregarios commentedHere is a link to an issue for why I couldn't get HTML email to work with Mail Edit: http://drupal.org/node/212224
Comment #2
salvisThank you for your well-thought-out and well-documented post. This is definitely interesting, but it looks like a big issue and I won't be able to get to it real soon.
If someone wants to work on this, I'll definitely support it, otherwise porting to D7 will probably get priority.
Comment #3
salvisHmm, an interesting alternative was posted in #212224: Mime Mail module: HTML emails and Plain text emails...
Comment #4
gregarios commentedYeah... I saw that. It seemed even more 'hack-ey' than the way I'm doing it. :-)
Comment #5
Rhino commentedsubscribing.
Comment #6
neek commented+1 critical for me
Comment #7
gaëlgsubscribing
Comment #8
hongpong commentedinteresting, subscribing
Comment #9
gregorygo commentedThere seems to have been quite a bit of progress on this since '09. This combination is working for me without any hacks:
Subscriptions + Mail Edit + Mime Mail
Tip: don't forget to insert br and/or p tags. Linebreaks don't get automatically converted.
Caveat: I don't need Rules integration, so there might be other roadblocks depending on your needs.
Comment #10
TelFiRE commentedI wonder what it is about your setup that causes those modules to work together. In Drupal 6 they do not :(
Comment #11
rooby commentedPushing to latest version.
I would love to see this module be usable with mime mail, without mail editor, which I really dislike.
Comment #12
gregarios commentedIt seems to work just fine now with Mime Mail and without Mail Editor, actually.
Comment #13
rooby commentedThat's great news, I will try it out, thanks.
Comment #14
rooby commented@gregarios:
Are you saying you don'teven have mail editor installed?
I'm not seeing how that works without the subscriptions_mail module, which requires mail editor.
Comment #15
gregarios commentedThat's correct. I just manually modified the subscriptions_mail.templates.inc file in the Subscriptions module to suit my needs.
Comment #16
rooby commentedOh, I thought you meant out of the box it worked.
That would also require removing the mail_edit dependency from the subscriptions_mail.info file too to not use mail edit.
Anyway, I need a cleaner solution than that this time so I guess I'll just have to put up with mail editor again.
Luckily I don't have too many sites that require subscriptions or I'd go mad.
Mail edit makes my site's mail setup so much more complex and confusing than it needs to be.
If only I could get a client to pay for me to work on a solution to this :)
Comment #17
rooby commentedI think some rules support could be a viable solution too.
If you could leave subscriptions_mail uninstalled and use rules to send out the mail on cron.
That would be a pretty user friendly solution too for non-coders.
Comment #18
karingIt actually does work out of the box: so without making manual edits to subscriptions_mail.templates.inc and with Mail Editor.
Comment #19
rooby commentedKarinG:
Yeah it works fine with Mail Editor, although we were just talking about using it without the Mail Editor module, which is the dream (mine at least :))
Comment #20
gregarios commentedOh... I'm using 6.x-1.5 which doesn't have the mail_edit dependency active.
Comment #21
salvis@rooby: Why are you so unhappy with Mail Editor? Please open an issue in the Mail Editor queue to discuss this.
Comment #22
rooby commented@salvis:
I think I'll have to eat my words on this one.
It's been a long time since I used mail editor and it has improved.
I also understand that there needs to be some way to customise subscription messages and implementing something in the subscriptions module would just be duplication.
Comment #23
salvisGood news, glad to hear.
I'm not sure why we have an NR status here. According to #14 this is working in the D7 version.