Thanks for a great work.

I think it's a good idea to try to make the module more modular - Use the standard drupal filters and allow to select which filters to use. This will allow me to add a new RTL filter, to allow right-to-left HTML emails (full spec). It will also allow to write a filter which will automatically add the company logo, or any other custom HTML.

A simpler way to get the same result would be to add a template option, to define the template around the HTML. It's not only HTML and BODY, sometimes it's needed to have a DIV with dir=rtl, or get the company logo on each outgoing email.

To summarize, adding a template field would be great.

Comments

druvision’s picture

Status: Active » Reviewed & tested by the community
StatusFileSize
new2.01 KB

Here is my patch - it allows to modify the HTML template body.

It's already working on two of my live sites - I've tested it with GMail, Yahoo Mail, and my local Thunderbird client and the mail looks great. Solves a great problem for me.

Amnon

Christopher Herberte’s picture

Amnon, I'm having trouble applying your patch. using patch 2.5.9 what options do you recommend?

druvision’s picture

make sure the current directory is the htmlmail module directory, then just

patch htmlmail.module < htmlmail.module.patch

druvision’s picture

StatusFileSize
new1.18 KB

The patch worked perfectly for version 1.0 as well.
It was a context patch.

Here is a regular diff-style patch:

diff htmlmail.module.orig htmlmail.module

> 
28,33c28
<     $body = "<html>\n" . 
<                       "<head>\n" .
<                                               "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n" . 
<                                               "</head>\n" .
<                                               "<body>\n" . $body . "</body>\n" . 
<                                               "</html>\n";
---
>         $body = str_replace ('%body', $body, variable_get('htmlmail_preformat_template',''));
98a94,110
>     $default_template = 
>       "<html>\n" .
>         "<head>\n" .
>       "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n" .
>       "</head>\n" .
>       "<body>\n %body\n </body>\n" .
>       "</html>\n";
> 
>   $form['htmlmail_settings']['htmlmail_preformat_template'] = array(
>       '#type' => 'textarea',
>       '#title' => t('Preformatted HTML template'),
>       '#default_value' => variable_get('htmlmail_preformat_template', $default_template),
>       '#description' => t('The message body to insert as preformatted html.'),
>       '#attributes' => array ('style' => 'direction: ltr;'),
>       '#rows' => '5'
>   );
> 
Christopher Herberte’s picture

Status: Reviewed & tested by the community » Closed (fixed)

committed prior to 1.0

lameei’s picture

hey guys
I'm new to drupal. I need to send RTL emails but the problem is that htmlmail is not compatible with D6. so is there new solution which I'm not aware?