Popular Drupal Email Features
A website or web system may have various reasons to communicate with website users or with Drupal CMS users via email. This article provides an overview of Drupal modules required to support the following features:
- Create a contact form
- Notify administrator when a comment is submitted
- Notify subscribed users of content updates
- Comment by email; Create site content by email
- Enable HTML formatting in email message
Create a contact form
As we all know, when you display an email address on a public web page for contact purposes it will be captured by spambots and added to junk mail lists.
To avoid this, you can use Webform to create an online form that enables site visitors to submit a message directly. The message and form content are then sent transparently to an internally specified recipient without making that email address known to the site visitor (or spambot).
With Webform you can:
- Define form fields to collect additional data from the submitter
- Set the internal email recipient one or more email addresses
- Make the internal email recipient vary depending on a selectable Subject field
Webform saves every message submitted with an option to review each one.
Note: Spambots can find and use webforms to submit junk mail, so you should also add CAPTCHA to foil them.
Notify administrator when a comment is submitted
With the core Comments module enabled, it’s nice to automatically be notified when a comment is submitted. To do this you’ll need to install the very useful Rules module.
With Rules installed:
- Create a new triggered rule.
- Select the Event “After saving a new comment”.
- For “Select an action to add”, Under “System”, select “Send a mail to an arbitrary mail address”.
- Complete the form that lets you set the email recipient and format the email message.
Notify subscribed users of content updates
The Notifications module adds the ability for website users to receive an email when content is added or updated.
Website users have the option to subscribe or unsubscribe for notifications. Users can elect to have emails sent immediately when content is updated, or to receive a weekly notification email with a summary of updates in digest form.
When an immediate notification is sent, the email message may contain some teaser text or the full node body from the website. In either case, it will also provide a link to the corresponding post on the website. A summary digest email will contain a list of node titles with links to the full node body on the website.
Notifications requires the Drupal Messaging and Token modules.
Comment by email; Create site content by email
To support online discussions via email, you’ll want to implement Mailhandler and Mailsave.
Mailhandler lets users reply to a content update notification email with a comment which will be added to that node’s comment thread. It also enables users to create content (create a new node) by email.
Mailhandler requires that you create external email accounts (with Google or Yahoo, for example) that will serve as the inbox for comments or new content being emailed to the site. Mailhandler routinely fetches content from the specified inbox. It adds a reply comment to the designated node, and it creates new content according to configuration settings.
To specify that incoming new content from an inbox should be used to create a new blog entry, for example, include these items in “Default Commands”.
type: blog // What content type are you creating?
format: 6 // The ID number of the Input Format it should be
created in. (From filter_formats table)If you’re using Organic Groups or Open Atrium, you can find additional configuration recommendations at Open Atrium, an Out-of-the-Box Extranet Solution
Use Mailsave to have an incoming email attachment become a file attachment to its new comment or new content node.
Enable HTML formatting in email message
By default, mail send from Drupal is in plain text format, which means it’s not visually interesting. Mimemail adds support for HTML formatted email by mime-encoding the HTML message body.
Mimemail will adopt your site’s theme by referencing its stylesheet files and converting CSS styles into inline style attributes.
If the recipient's preference is available and they prefer plaintext, the HTML will be converted to plain text and sent as-is.
1 comment
mailsave replacement
I found http://drupal.org/project/mimedetect and http://drupal.org/project/mimerouter work well instead of mailsave.
Post new comment