Closed (fixed)
Project:
Mime Mail
Version:
5.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
20 Nov 2007 at 16:40 UTC
Updated:
4 Mar 2008 at 03:21 UTC
I've been working to make the xpertmailer library work with mimemail as an external mailengine. I'd like to have xpertmailer actually construct the message, however, and the current structure of the mimemail function doesn't allow this, it always uses mimemail_prepare.
It would make things easier if mimemail determined the engine first, and then checked for a custom prepare function. For example:
function mimemail($sender, $recipient, $subject, $body, $plaintext=null, $headers=array(), $text=null, $attachments=array()) {
$engine_prepare = variable_get('mimemail_engine', 'mimemail') .'_prepare';
if (function_exists($engine_prepare)) {
$message = $engine_prepare($sender, $recipient, $subject, $body, $plaintext, $headers, $text, $attachments);
}
else {
$message = mimemail_prepare($sender, $recipient, $subject, $body, $plaintext, $headers, $text, $attachments);
}
$engine = variable_get('mimemail_engine', 'mimemail') .'_mailengine';
if (!function_exists($engine)) {
return false;
}
return $engine('send', $message);
return false;
}
Comments
Comment #1
allie mickaI have a bit of a philosophical issue with this one. Mime Mail's main job is to create some consistency around mail messages, so diverting its message building is sure to create some drama later.
The mimemail_prepare function is where user's plaintext settings are respected. If your module, for example, does not respect these settings, we'll make a liar out of the UI. Additionally, if the message structure or user options change in some way, or certain API changes occur ( e.g. with the just-committed mailkey patch), xpertmailer and friends won't be consistent with those.
By eschewing everything that Mime Mail does, I'm not really sure what you'd get out of using it - except for a single-point-of-entry for formatted messages. Maybe that's enough.
All that said, it's your funeral :). I'm committing this to HEAD, so have fun with it!
Comment #2
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.