I have been searching for two days now and tried many different ways to try to customize the notification emails sent out to users from the core contact.module

I've tried using html in the "auto-reply" form found at /admin/build/contact/edit/ - but tags get arbitrarily inserted when the auto-reply is sent from Drupal so it breaks any html code put in the form.

I've tried the htmlmail module, the mail api module, among other things but nothing seems to work.

Mostly I'd like to include a logo in these outgoing notifications and format the test so it look nice. Is this just not possible?

Any ideas or suggestion would be very welcomed.

Many thanks

Comments

zilla’s picture

check out: http://drupal.org/project/mimemail

as for text in notifications, the one i'm familiar with is in admin/site configuration - same place where you change mission statement and that stuff, scroll down and you'll see options to change all of the text that goes out with registration related emails (pw reminder, etc)

sharkmeat’s picture

Unfortunately I already have mimemail as an installed module and still having the same problem.

The email notification is generated by the core contact module when a user enters information into the site-wide contact form. An auto-reply email is generated and sent to the user - THIS is the notification I am trying to format so that it look nice and not some plain text email.

For example if I put the following in the auto-reply field on by going to www.example.com/admin/build/contact and then selecting the category to edit.

<p align="left" >Thank you for contacting <strong>Shark Meat Records</strong>.</p>
<p align="left">
This is an automated response just to let you know we have received your email.  We will respond within 48 hours to your request.</p>
<p align="left">
For online information about submitting your demo or press kit, please visit our Demo Submissions page at: <a href="http://www.sharkmeatrecords.com/demo-submissions">http://www.sharkmeatrecords.com/demo-submissions</a></p>
<p align="left">
Shark Meat Records<br>
342 Broadway, Suite 350<br>
New York, NY 10013<br>
USA</p>
<p align="left"><a href="http://www.sharkmeatrecords.com">www.sharkmeatrecords.com</a></p>
<p align="left"><img src="http://www.sharkmeatrecords.com/sites/all/themes/sharkmeatrecords/logo.png" width="225" height="80" alt="Shark Meat Records"></p>

I do not get a nice html email sent to the user - I get this

Thank you for contacting Shark Meat
Records.
This is an automated response just to let you know we have received your
email. We will respond within 48 hours to your request.
For online information about submitting your demo or press kit, please
visit our Demo Submissions page at:
http://www.sharkmeatrecords.com/demo-submissions
Shark Meat Records

342 Broadway, Suite 350

New York, NY 10013

USA

href="http://www.sharkmeatrecords.com">www.sharkmeatrecords.com

src="http://www.sharkmeatrecords.com/sites/all/themes/sharkmeatrecords/logo.png"
width="225" height="80" alt="Shark Meat Records">

If you look at the source code in the email you will see this:

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
<p align="left" >Thank you for contacting <strong>Shark Meat<br />
Records</strong>.</p>
<p align="left">
This is an automated response just to let you know we have received your<br />
email.  We will respond within 48 hours to your request.</p>
<p align="left">
For online information about submitting your demo or press kit, please<br />
visit our Demo Submissions page at:<br />
<a href="http://www.sharkmeatrecords.com/demo-submissions" title="http://www.sharkmeatrecords.com/demo-submissions">http://www.sharkmeatrecords.com/demo-submissions</a></p>
<p align="left">
Shark Meat Records<br><br />
342 Broadway, Suite 350<br><br />
New York, NY 10013<br><br />
USA</p>
<p align="left"><a<br />
href="http://www.sharkmeatrecords.com">www.sharkmeatrecords.com</a></p>
<p align="left"><img<br />
src="http://www.sharkmeatrecords.com/sites/all/themes/sharkmeatrecords/logo.png"<br />
width="225" height="80" alt="Shark Meat Records"></p>
</body>
</html>

You can see that random <br /> tags have been placed into the email rendering the html output useless.

Any ideas suggestions?

As i mentioned I have the following helper modules installed:
http://drupal.org/project/htmlmail
http://drupal.org/project/mail_api
http://drupal.org/project/mimemail

Thank you.

zilla’s picture

i don't use html in emails, nor manage this kind of issue - just the simple contact form in core...but this must have been resolved before, certainly worth digging around in forums (i use google for this btw, searching drupal is too slow for me, so try site:drupal.org and whatever you're trying to dig up...)

perhaps it has something to do with the html_to_text function discussed here? http://drupal.org/node/154218

damban’s picture

Wow, this is an old post.

Please someone tell me I am stupid, however I can't find this equivalent email config in D7 www.example.com/admin/build/contact

I desperately need to change the contact.module text that accompanies an email sent to a user via their contact form.

damban’s picture

Anyone?

After so much work this is an absolute show stopper for my Drupal site. I'd rather not simply edit the text from the Contact.module, and do not know how to use hooks.

Jedd Casella’s picture

You've probably done all this already but I'll post it anyway.

Configuration - > Account Settings --- Changes Automatic email responses.

Use Actions and triggers for creating your own based on custom conditions. Use rules for everything else.

Hope this helps.

damban’s picture

Thanks Jedd, however unfortunately Configuration - > Account Settings does not allow me to edit the Drupal text that accompanies an email from a user's contact form.

I assume Actions and Rules are modules? I'll look into them

damban’s picture

Getting desperate. Is there ANY simple way for me to edit the text which Drupal inserts on emails ti my website members?

Jedd Casella’s picture

So are you talking about the emails sent from the contact form? You can edit the text here
http://www.example.com/admin/structure/contact
For an example:
http://www.example.com/admin/structure/contact/edit/2

Can you provide an example of where the email is sent from i.e. www.example.com/contact

What you are asking for sounds pretty simple. It obviously isn't. Just needing further information so I can understand your problem better.

damban’s picture

Hi Jedd, thanks for your reply.

The emails in question are those sent by the personal contact form www.example.com/user/%uid/contact

And they are not customizable via www.example.com/admin/structure/contact

Jedd Casella’s picture

Looks like you might have to create your own custom module to do what you need...

You could do it the rough way and modify the contact.module but I highly recommend against it.

Jedd Casella’s picture

Looks like the works already been done! See:

https://drupal.org/node/1212144#comment-4710770