Development Seed Blog

Reply ABOVE this LINE to POST a COMMENT to a Drupal Site

Plug In Gives You the Best of Both Email and Web Forum Features

Plug In Gives You the Best of Both Email and Web Forum Features

"Reply ABOVE this LINE to POST a COMMENT." This is how automatic email notifications from the teams' intranet blog posts look these days. And it's true! Now I can just reply to any email notification I receive and my comment will appear on our intranet. The only bad thing is that I don't have an excuse anymore for not replying right away ;-)

Typically there are two ways to carry on online discussions and to keep up with the replies - mailing lists (that may have a web interface) and web forums (that may have email subscriptions). Though each of one has its own advantages and drawbacks, trying to mix both usually ends up in long threads of differently formatted messages. Besides, mailing lists are usually exposed to spamming (worse yet if spam ends up on the web) and the "from" address is really easy to forge.

As usual, we wanted it all - the reliability and readability that come with authentication in a web forum and the ease of replying through a mailing list. Since we already had the Notifications and Messaging framework and an excellent mailhandler module to fetch incoming emails, it was just a question of putting the pieces together and adding some extra security/authentication into the recipe to get to this. 

Check the new "Mail2web" plug-in in the Notifications module. This first version is for Drupal 5. And by the way, we just released the Drupal 6 version of both Notifications and Messaging modules. The Mail2Web Drupal 6 version, however, will have to wait for the mailhandler module.

Being paranoid about security and spam, we added a more secure method for message authentication than the ones currently used. Our outgoing emails have some digitally assigned parameters that are checked when the reply comes back. Thus only emails posted as a direct 'Reply-To' operation will get in as responses. And replies to a given thread will get only into that thread, nowhere else. But best of all, these tokens are completely invisible for a regular user and should work with most email clients without the need to install any extra software. (You can set an expiration time frame for replies too).

So what do I need to to do to get it working?

1.  Install Mailhandler and set up an inbox for it to use to fetch email.
2. Install the notifications and messaging modules and set up the notifications and messaging methods to be used. You'll need at least one email method enabled. We have three available - the Drupal default mail, PHPMailer, and MIMEMail.
3. Enable the Notifications Mail2Web module and configure it.

4. Have fun and save time replying to your site users or teammates' comments directly from your inbox.

Also included in this Beta2 is a 'Notifications Lite' API module, which is a tool intended for developers to send simpler and easier notifications from their modules. As easy as

  notifications_lite_send($user->uid, "Hey, this is a simple
notification for you.");
  // I just don't know whether you'll get it by email or by SMS, that will depend on your personal settings.

You can Reply BELOW this LINE to POST a COMMENT.

Comments
Hi! Excellent post and a

Hi!

Excellent post and a good read.

I would like to ask, what happens in the case that there is an attachment together with the email. Does the attachment get translated together into the node or comment?

There are some modules out

There are some modules out there that add attachment handling to mailhandler, like http://drupal.org/project/mailsave

However, this module we've done only handles comments atm (and will convert all mails to comments if there's a thread matching) but will drop the posts otherwise (that's related with the 'extra security' part).

So it may work with attachments for comments, but we haven't tried that part yet. Let us know how it works if you try.

Just what I need.

Just what I need on one of my sites for a non-profit.

Is this just for regular forums or does it work with OG-OrganicGroups also?

Thanks for the security check on incoming responses. Although it may not need it, would it still interface with Mollom if it's installed.

Yest it is for regular

Yest it is for regular forums/comments. It doesn't depend on OG, though you could use it together with OG.

About Mollom I cannot really tell, but if Mollom works with mailhandler's incoming posts, it should work.

Great stuff

This is brilliant, I'll definitely be playing around with this on the weekend.

How does this work with nested comments?

One of the real advantages

One of the real advantages of this system is that it works great with nested comments, and posts should go straight into it's thread.

The comment you're replying to is part of that 'digitally signed' parameters so it should match 100% of the comments to the right thread.

This is an exciting

This is an exciting development, but how exactly do you get it to work with organic groups? When I post something to my organic group, it sends the same emails it did before I installed the modules I need for this setup. Do I need to change something in admin/og/og to bypass the settings there?

Post new comment
The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <img> <p> <li> <ul> <ol>
  • Lines and paragraphs break automatically.
  • Web page addresses and e-mail addresses turn into links automatically.

More information about formatting options