Is anyone busy making a Drupal 7 version for this module?

CommentFileSizeAuthor
#31 mimemail.939208_02.patch2.12 KBsgabe
#8 mimemail_939208_01.patch48.47 KBsgabe
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Jelle_S’s picture

Status: Active » Needs work
sgabe’s picture

Status: Needs work » Active

Are you? :)

sgabe’s picture

I have merged HEAD into the DRUPAL-6--1 branch, so we can work on HEAD for the Drupal 7 port. I started to work on this a few weeks ago and I have some ideas but nothing solid yet. I'll try to post some more here when I'll found the time for it.

In the meantime you can share your thoughts here about Mime Mail for Drupal 7.

chx’s picture

Issue tags: +gci-code

Task title: Port mimemail to Drupal 7

Task description: This module allows Drupal to send HTML mails. It is the 66th most used module with more than 20 000 sites using it. The task is to port the module to Drupal 7, by performing the API changes outlined in the resources to get the module to work properly. By doing this task you will learn about the brand new Drupal 7 API and Drupal mail handling.

Deliverables: The module working with Drupal 7 and also either automated tests or documentation why that's not feasible.

Resources:

dmitrig01’s picture

chx’s picture

Issue tags: +needs mentor

adding mentor needed tag.

sgabe’s picture

FileSize
48.47 KB

I've got a patch against current DRUPAL-6--1 branch. I tested only with the core Contact module, since Simplenews and Webform seems to be unusable ATM. It can be a good start if you would like to play with it.

miro_dietiker’s picture

I'm glad mimemail goes D7. We're going to test it extensively with simplenews for D7 development within the next days.
Why not just pushing the patch into CVS to proceed in separate steps?

Is there something missing or todo?

Andy B’s picture

subscribing

Andy B’s picture

Title: Drupal 7 port » Port mimedetect module to D7

Changed title for better use in the dashboard.

sgabe’s picture

Title: Port mimedetect module to D7 » Port Mime Mail module to D7

This is the Mime Mail module. :)

Andy B’s picture

Uh, OOPS! Was thinking of mimedetect when posting.

sgabe’s picture

@miro_dietiker: There are some modifications included in the patch which could use some discussion.

I didn't have the time lately to finish it, but otherwise it seems okay. I guess it could be committed without these modifications and we can continue in separate issues, but I'd be happy if someone reviewed it before commit.

Sylvain Lecoy’s picture

subscribing

lolandese’s picture

Subscribe

achton’s picture

subscribing

webankit’s picture

subscribing

sgabe’s picture

I decided to take the first step and commit something at last, so we can really start thinking about Mime Mail for Drupal 7.

In Drupal 7 you can use drupal_mail() with different mail systems for any mail provided by hook_mail(). Since drupal_mail_system() will determine the responsible system for your message, in order to use Mime Mail for your emails you need to modify the $mail_system variable like this:

array(
  'default-system' => 'DefaultMailSystem',
  '{$module}_{$key}' => 'MimeMailSystem', // Just messages with $key sent by $module.
  '{$module}' => 'MimeMailSystem', // All messages sent by $module.
);

Make sure to not overwrite the whole array just append your mail to it! See the function documentation for more details.

The mimemail() function is removed in favor of drupal_mail(). Now $params should contain the optional $plain, $plaintext and $attachments variables, the module will pick them up from there. You can set these either before calling drupal_mail() or in hook_mail() and of course hook_mail_alter().

The development branch contains the following patches made for 6.x-1.x-dev:

And some other changes, that I simply can't enumerate.

I have tested with core Contact module as default system and Simplenews (modified according to above) as responsible mail system for it's messages.

It seems to work fine for me, so enjoy and let me know what you think. The changes will be available in the development snapshot tomorrow.

quicksketch’s picture

Thanks for your work on this sgabe. The D7 version sounds very interesting. Could you update the README.txt file with instructions on how to both install the D7 MIME Mail as well as use the API?

perarnet’s picture

sgabe: Thanks for the work, could you perhaps attach a patch of the modified simplenews changes?

sgabe’s picture

Unfortunately I don't have time to create patches, but I will update and add some instructions to the README.txt as quicksketch requested.

sw3b’s picture

Subscribe !

karbofos’s picture

subscribing

sgabe’s picture

I updated the README.txt with some information. I don't know if that's enough, so please ask if needed, I will try to help.

joostvdl’s picture

subscribe

3n9’s picture

sgbabe, could you post a working example how to send html email from our own modules? Like: http://api.drupal.org/api/drupal/includes--mail.inc/function/drupal_mail...

sgabe’s picture

@3n9: I think there is nothing to add. You can use drupal_mail() like you did so far. The difference is that drupal_mail() can retrieve the responsible implementation for the message and send it using that system. So, you need to modify the mail_system variable as I mentioned above.

However, the system actions and the Rules integration in the module should be a good example.

quicksketch’s picture

Hi guys, if anyone can provide some help I'm not able to figure out how to use MIME Mail in Drupal 7. I'm a pretty smart guy, but either MIME Mail isn't ready for use or there's some kind of trick to using it. Since the whole system is undocumented (AFAIK), it's hard to tell which is the case. The new README.txt is not helpful from a developer-standpoint of how to integrate with the module. The issue for Webform is over at #1043086: Include attachments and HTML e-mail options not working (MIME Mail integration). Any help would be appreciated.

sgabe’s picture

I have attached a patch for Simplenews in #1048254: Support Mime Mail on Drupal 7, I will take a look at Webform too ASAP to help you move forward with this issue.

sgabe’s picture

FileSize
2.12 KB

I have attached a patch for Webform in #1043086: Include attachments and HTML e-mail options not working (MIME Mail integration), I hope that helps. I would appreciate if anyone could let me know what to add to the documentation. I thought that it's clear but clearly it isn't. Sorry, it's my bad...

sgabe’s picture

Status: Active » Closed (fixed)

We have an initial port of Mime Mail for Drupal 7. Let's continue in separate issues.

cwyant’s picture

sub

triple5’s picture