Hello,

What is the best way to remove the glue between the sections without hacking the module? Right now it is
. I already have all the line breaks set via HTML in each template section. The glue adds an unwanted extra break between each section... I changed final filter to "none" and that didn't work. If you have any tips, that would be great. Thanks!

/**
 * Implementation of hook_messaging
 */
function messaging_mime_mail_messaging($op = 'info') {
  switch($op) {
    case 'send methods':
      $info['mimemail'] = array(
        'title' => 'Mime Mail',
        'name' => t('Mime Mail'), // Name for display
        'description' => t('Send e-mails using Mime Mail module.'),
        'address_type' => 'mail', // Type of address 
        'group' => 'mail', // Class of send method
        'glue' => "<br>", // don't use <br/> nor <br /> for maximum HTML email client compatibility
        'footer' => "-- \n",  // Separator for message footer
        'send callback' => 'messaging_mime_mail_send_msg',  // Sending callback
        'class' => 'Messaging_Method_Mail',
        'filter' => 'messaging_html', // Default filter for this format
        'anonymous' => TRUE, // This method supports anonymous destinations
      );
      return $info;  
  }
}
CommentFileSizeAuthor
#2 Picture 38.png78.29 KBMac Clemmens

Comments

jose reyero’s picture

This can be changed with some code (hook_messaging_method_info_alter()) but I guess this is not what we are looking for.

Maybe we should add a configurable option here. Would a newline work for you? (try replacing it with "\n")

Mac Clemmens’s picture

StatusFileSize
new78.29 KB

Yeah, that's what I changed it to, and it worked great. I think just having a variable would be great, even if it were not changeable by the UI or anything, because it could be overridden if needed:

'glue' => variable_get('messaging_mime_mail_messaging_glue', "<br>"),

Then I could use strongarm, etc., to pass the configuration onward without any patches or other modules. Might be a clean fix.

I've attached the result -- very clean and no extra linebreaks. :) I'm new to this module from subscriptions and have already become hooked.

jose reyero’s picture

Actually you have two (array) variables that can override these settings:

'messaging_method_mimemail'
'messaging_filters_mimemail'

Try the first one with

$conf['messaging_method_mimemail'] = array(
   'name' => t('Mail'),
   'glue' => "\n",
);

See messaging_method_info() for more clues.

loze’s picture

I am having trouble getting mymodule_messaging_method_info_alter() to fire. am I calling it correctly?

Im trying to alter the glue variable for phpmailer

loze’s picture

I figured it out. The function should be hook_messaging_send_methods_alter(&$info)

kenorb’s picture

Status: Active » Fixed

Try: hook_messaging_methods_alter

E.g.

function foo_messaging_methods_alter(&$info){
    unset($info['mimemail']['glue']);
    unset($info['mimemail']['footer']);
    return $info;
}

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.