By desm0n on
How do you send new registration details to members signing up as formatted HTML ?
Currently it only send as plain text, showing the formatting tags of HTML included.
Is there a switch i'm missing or something ?
How do you send new registration details to members signing up as formatted HTML ?
Currently it only send as plain text, showing the formatting tags of HTML included.
Is there a switch i'm missing or something ?
Comments
It's not a bug, it's a feature
A lot of people are pissed off by HTML mail. It's not a good idea to present a switch to piss off a lot of people. So drupal does not provide a switch to send HTML mail.
--
~/.singatrue: file not found
So theres no way to send
So theres no way to send HTML emails ?
If you format the emails properly they can look ok in both, when the user decides to turn HTML off at their email client end, however i prefer to have the choice as most of my members are new to the Internet and prefer a more visual email to one thats plain text and often confusing to them.
Are you saying there is no way to send HTML registration email with drupal without hacking core modules ?
--
http://www.porttalbotchat.co.uk
-------------------------------------------------
Our mission is to discuss issues and topics of residents of Port Talbot. We provide info on events, issues, concerns and discussions of our local area.
That's right
That's right. Sending HTML messages not only involves sending the message body in the right format. You also need to send the appropriate message headers (according to RFC 2045 and maybe RFC 2822).
--
~/.singatrue: file not found
No it's not
Mails are send using user_mail(). This function looks for a variable named "smpt_library". The value is the name of a file to be included. The included file must implement the function
user_mail_wrapper($address, $subject, $message, $header);to do the delivering. That's the time where you have the chance to send messages as HTML. If you are not firm with the related RFCs, I suggest you implement the wrapper to use one of the available mail classes (like PHPMailer from sourceforge).--
~/.singatrue: file not found
I do think this is a big
I do think this is a big oversight of Drupal not to allow flexability here.
After all, the system is very flexable in almost every area and yet i would say this is a fundemental basic issue for most admins of CMS systems.
The first point of contact between user and webmaster is within the welcome email. Having HTML formatting really helps to address and layout out issues and instructions to new members.
I wouldn't have the first idea how to implement any third party programs within drupal or indeed any wrappers. So if anyone has any guidelines to achieve this, i would really appreciate some feedback.
--
http://www.porttalbotchat.co.uk
-------------------------------------------------
Our mission is to discuss issues and topics of residents of Port Talbot. We provide info on events, issues, concerns and discussions of our local area.
You are at least partially right
The philosophy of drupal is to provide minimal functionality and to provide a framework to easily extend/modify this functionality. This goal is achieved by many parts of drupal, but there is still a lot of work to be done. Sure, implementing a "smtp_library" is not what I call easy, especially when taking into account that once HTML mail can be sent easily, people want to theme their mails just as easily.
BTW: In version 5.0 there exists a hook_mail_alter() (I only discovered it right now), that lets you modify every aspect of mail formating (headers, body, recipients, etc.). Until there are modules that use this hook to format the mail as HTML (the hook is new to drupal 5.0), your choice is to write one on your own (though this might not be the appropriate answer in the Post Installation forum).
Yes, ... sometimes. It's really the same as with WYSYWIG-Editors: some can't live without them, some consider them a PITA.
Grettings
--
~/.singatrue: file not found
Please don't think me
Please don't think me ungrateful or trying to belittle Drupal here as this really wasn't my intentions.
However as powerful as it is, sometimes little things just get left and forgotten.
For instance the new posts bug that won't direct over pages gets left out on every new release, which has been an issue for months. Its minor sure, but really annoys the hell out of users. Us admins accept it quickly and move on, but users have to eventually use the system we create.
I know these things are not easy and are far more complex than we sometimes give them credit for. But a hook, like what you describe in Drupal 5.0, really could and probably should have been introduced a very long time ago on a system that has so much flexability in almost all areas.
HTML email isn't the same as a WYSIWYG editor at all, but i won't argue.
As regards the issue at hand, i guess i'll have to wait till version 5.0 and hope someone looks into these issues. At least its again out in the open (i found several posts on drupal about the same issue but no solution). And discussion and debate very often is more beneficial than keeping quite :)
--
http://www.porttalbotchat.co.uk
-------------------------------------------------
Our mission is to discuss issues and topics of residents of Port Talbot. We provide info on events, issues, concerns and discussions of our local area.
Indeed...
BTW, I agree with this user's assessment of the problem...sounds like an upgrade to 5.0 issue...but I'm reluctant to do that until it comes out of beta...
Frankly, I'm also am also somewhat surprised that this, what I consider to be more than a matter of style issue, has not been addressed before...perhaps a cultural issue of European minimalism versus American more-ism:)?
Any other work arounds other than the CSS hack referenced in a follow-up?
Thx
Mick
**But he hastens to add..."Drupal is (still) all good..." **
BTW i would hardly call an
BTW i would hardly call an omission a feature.
And to note, i just received 4 new emails, from big companies, all of which sent as HTML. These included Amazon and Play.com
Has anybody hacked core to send HTML as i really do believe this will increase clickthroughs to my signups. Very often users don't validate their email and i'm convinced this is due to plain text in relation to HTML and easier viewing of the automated send out email.
--
http://www.porttalbotchat.co.uk
-------------------------------------------------
Our mission is to discuss issues and topics of residents of Port Talbot. We provide info on events, issues, concerns and discussions of our local area.
HTML Email
Account login information is critical, so I would strongly recommend not using HTML emails to send it.
If branding is more important than reliability, then this is a really useful article on how to get CSS to work well in HTML emails on at least the majority of email applications:
http://www.alistapart.com/articles/cssemail
Cortext Communications
Drupal Themes & Modules
------------------------------------------
Drupal Specialists: Consulting, Development & Training
Robert Castelo, CTO
Code Positive
London, United Kingdom
----
I couldn't agree more and
I couldn't agree more and this is why i see HTML as the best way to present this information in a clear and easy visual manner.
You can design emails with HTML to look ok if the clients HTML options are turned off. However the key word here is ok, not great.
I'm not talking about branding either with logos, pictures and the like. Just basic bullet lists, Headers and clickable links (granted the latter is taken care of by 99% of email clients).
Pretty much most of the big boys send as HTML and they have probably conducted far more market research than i have on these issues.
Members need clear, concise and easy to read information and HTML is a perfect media for such things. This is why we use HTML on websites and why almost all email clients support the format. So why limit a powerfull platform like Drupal to just plain text output ?
At the very least i would have thought that core would have had the very real possibilities to use the Mime Mail module, http://drupal.org/project/mimemail which would solve these issues and give admins a choice on whether to adopt HTML emails or not.
Views on this would be appreciated .
--
http://www.porttalbotchat.co.uk
-------------------------------------------------
Our mission is to discuss issues and topics of residents of Port Talbot. We provide info on events, issues, concerns and discussions of our local area.
some assumptions
1. Would have thought core........ No. If no one submits a patch, then it won't happen.
2. All the big boys do it .... Again, improperly done html email has a significantly higher chance of being blocked by mail servers as spam. I know my company does this as I helped design the policy and implement the anti-spam stuff. (but it can be done properly -yes, that takes time and attention to do right doesn't it?)
3. But the big boys do it..... see Number 1.
4. But some contrib module does it........ See #1. Contrib modules generally do not make it into core. Feature sets in the form of api's and such get migrated into core (see #1) if someone does the work and it is accepted by enough people.
If someone wants a feature, then they need to make a feature request. If you are coder, then provide code. If you are not a coder,t hen mock ups, expected work flow, use cases it is expected to solve, etc are all useful things to perk someone else's interest.
-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide -|- Black Mountain
-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide
I agree in part with some of
I agree in part with some of your conclusions here Steven, but in a development platform as powerful as Drupal it should have seemed obvious from an early development that HTML email is important to many admins.
I'm not saying i cannot survive without it, far from it, its no show stopper. However the very fact that market research and research and development that would have been undertaken by "the big boys" in online presence, those i add that do indeed adopt HTML emails (and i have yet to find one that doesn't) would prove conclusive that HTML, for the most part, is widely accepted as an email transit.
We keep hearing improperly done HTML emails have a higher chance of getting deleted through Spam filters but this is also the very same issue of improperly formatted emails in general.
Should we weaken the position of a Drupal system on its very first contact with a user by taking the position that HTML could be blocked by spam filters, or should we, as a platform that advocates flexibility, allow for both types of emails to be sent.
Now you say to request such a feature, and I'll gladly do this if pointed in the right direction, but when it comes to drupal core i have to admit I'm not entirely sure where to make such a request. As regards mock-ups and work flow projections ? well mock-ups are not needed as the present input system will suffice with just a tick box saying send as HTML. Work flow ? Well not being a coder i wouldn't have a clue where to start here so that would need explanation on what is expected.
As I've said many times before, I'm a simple admin and work with my users, the users of a live Drupal system, to identify issues that make their life more difficult. The very first point of contact is in the validation email and this has and continues to cause confusion on layout. Granted all the pieces are in place and they receive the details needed, but we are talking here about non admins, non html designers and non programmers that wish to register as quickly and as easily on site as possible. HTML, in this case, will achieve a visual look that can aid in that. By simply adopting bold and headers it would clean up the email considerably.
In fact maybe a welcome email would be a good implementation as well. So the user gets a validation email, registers, then is sent a welcome email, addressing first use issues, guiding them to features of the website etc.
I'm sure you agree that most users of the systems we create do so because of interest in the subject first and are not always as technically proficient as we would expect. In my case we have an older generation turning to computing for social networking. This generation may never have signed up to such a site before and becomes increasingly confused as to what to do next.
To this end I'm now re-writing my sign up guidelines, using HTML, and will try and layout my TXT based emails in a better format as we have had 30+ of 173 registered members who have failed to validate using the email sent.
It is a usability problem from a users prospective and one i would like to see addressed without me having to hack and continue to hack core files. This is why, and only why, i address this issue now.
In actual fact i was amazed it wasn't already in place. I spent best part of half a day writing out my newly formatted email and was overly shocked to see how it was sent. I assumed from the get go this facility was already in core, as, as you say, many contrib modules send as HTML, TXT or both. I find it irony that drupal.org itself can adopt the SimpleNews contrib module for its newsletter, a module that can and does quite easily send out emails as HTML, and yet its own core system cannot.
These things are not brought up to knit pick, they are brought up to help make the system better for admins and users alike. If something is lacking, it really should be discussed and the main reason i opened the forum discussion was because i simply thought it was me, missing a switch to turn such a feature on. Now that i review the situation more, it appears that oversight has either left the feature out entirely or it simply wasn't deemed important. However, i assure you, for some it is and maybe we need to look into this.
--
http://www.porttalbotchat.co.uk
-------------------------------------------------
Our mission is to discuss issues and topics of residents of Port Talbot. We provide info on events, issues, concerns and discussions of our local area.
To follow up with this this
To follow up with this this morning i have re-introduced the logintoboggan module to our site this am.
This has allowed me to take out the portion of HTML i wished to use in new signup emails and redirect new signee's to HTML pages on the website.
Its not ideal but does work and allows a kind of "welcome mail" to be generated, albeit on site.
I still stand by needing HTML but this solution allows me some flexibility under the current restrictions.
The only reason i didn't introduce it before was the last time i used the module we had some issues with members not being able to post comments etc. Hopefully this is all now addressed.
--
http://www.porttalbotchat.co.uk
-------------------------------------------------
Our mission is to discuss issues and topics of residents of Port Talbot. We provide info on events, issues, concerns and discussions of our local area.
Yep, it seems logical to have it as an option
I agree with you mate. It seems like a very basic admin option to have, given the power Drupal brings to the table in so many areas. At the end of the day though, we all have the option to create change by hiring a coder, if you can't do it yourself. There's a lot of good Drupal coders around.
Your logintoboggan solution is a good way to get around this Drupal "feature". ;-)
...
That's a long and interesting post. I neither agree or disagree. You have your needs and that's fine. But when you 'express shock', you are also indirectly assuming your needs are everyone's needs. You are saying that you can't possibly see why others haven't already done this in preparation for meeting your needs.
I was trying to explain the why's of existing and how to get your needs addressed. To do this, you need to get involved in the development cycle. People contribute code to meet 'their' needs. If you can't contribute code, then you can contribute UI design, testing, qa and feedback (which is what I do). All of this needs to be done by someone.
Everything I said in my post was to educate you to the fact that 'we' is the people that deem it is important. I have no need for this feature. I would probably benefit by it, but as I have had no need for it for my sites, it is not something I would have thought of to give any consideration too. That doesn't mean someone else doesn't want it though. There are a lot of people using Drupal. Someone needs to get involved in the development cycle early if they have a need that doesn't exist and work towards getting it addressed.
I do not say your need isn't valid. I do not say your need isn't a good idea. I said, nothing gets done without people getting involved and working towards filling their needs and provided several ways for this to happen. Does that make sense?
-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide -|- Black Mountain
-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide
Perfect sense steven and i
Perfect sense steven and i do agree with you.
I wish i was in a position to not only offer constructive feedback in this way, but code to make it happen.
Sometimes, as we have discussed many times in these here forums, we need to step back and see how our users use our system. Its great putting in all the bells and whistles, but if we forget fundamental points that really make their life difficult we are failing them. After all, our sleeky designed sites are nothing without usability and we create them for the end users, not us that generally know far more than they.
I'm not saying this is the case here, however my post was to highlight a need that will get strong, in my opinion at least, as drupal is taken up by more and more admins.
Admins are not coders and will always bring up issues their users face.
I'm more than up for beta testing and helping with UI design and implementation but the act of coding is unfortunately beyond my scope. Trust me letting me loose on core with limited php skills is a receipt for disaster :)
I do see your point and have done on many an occasion. Everyone is different but the system is flexible enough to cope with many a need. When its not, it should be raised in the open for discussions on the whys and what fors. This is where my post falls.
--
http://www.porttalbotchat.co.uk
-------------------------------------------------
Our mission is to discuss issues and topics of residents of Port Talbot. We provide info on events, issues, concerns and discussions of our local area.
Well I have managed to do
Well I have managed to do it, it's not an option but I DO have a hack for it. In the common.inc file replace the line:
'Content-Type' => 'text/plain; charset=UTF-8; format=flowed',with
'Content-Type' => 'text/html; charset=UTF-8; format=flowed',and all emails sent using drupal_mail() will be perfectly formatted html, it is also possible to change this on a per-module basis.
-----------------------------------------------------------------
Michael O'Toole
Gay Youth :: South East - Chair & Operations Administrator
Another way to implement HTML Mail into Drupal:
Hi.
There also is a module which alters Drupal's mail function and wraps it with HTML. You just need to insert body.
Check it out at http://drupal.org/project/htmlmail
Need real server security? Get in touch
Try the HTML Module. It
Try the HTML Module.
It should serve your purpose and can be downloaded from: http://drupal.org/project/htmlmail
Chris
This is quite simple to achieve.
All you need to do to send HTML emails is to:
1. Have an HTML formated content as body of the email. For this, use any supported WYSIWYG editor to edit and store your e-mail template as a node or through (variable_get/variable_set).
2. Implement hook_mail to prepare the message. During this phase, make sure to set the appropriate headers.
Live long ... and prosper!
you can use hook_mail_alter()
drupal_mail()before send mail invokehook_mail_alter()to allow all modules to alter the resulting e-mail, then you can use this snippetWorks perfectly!
All I wanted was to add a simple logo/header to my site emails so they don't look so plain (branding is important, after all). I was looking into the HTMLMail module and a few other options, and they all just seemed like overkill for what I wanted.
AexChecker's solution worked perfectly. I popped it into my module, and now every email goes out with my header graphic. Only downside is having to go back and wrap all my email text in
tags to get the appropriate line breaks, but I don't send too many emails to site visitors, so it wasn't a big deal.