In ces_offerswants.install:

function mymodule_enable() {
  $current = variable_get('mail_system', array('default-system' => 'DefaultMailSystem'));
  $addition = array('mymodule' => 'MymoduleMailSystem');
  variable_set('mail_system', array_merge($current, $addition));
}

function mymodule_disable() {
  $mail_system = variable_get('mail_system', array('default-system' => 'DefaultMailSystem'));
  unset($mail_system['mymodule']);
  variable_set('mail_system', $mail_system);
}

(Needs in hook_update too, for sites in production)

In offerswants.module:

class MymoduleMailSystem extends DefaultMailSystem {
  public function format(array $message) {
    $message['body'] = implode("\n\n", $message['body']);
    $message['body'] = drupal_wrap_mail($message['body']);
    return $message;
  }
}

(This is avoiding function html_to_text() in class DefaultMailSystem)

Comments

XaviP created an issue. See original summary.

  • XaviP committed 99b7b7a on 7.x-1.x
    Issue #2663206: Email alerts in html. Needs work on better layout email...
XaviP’s picture

With this last commit, the module ces_offerswants sends emails with html tags.
In a live site, it needs to run update.php for updating email_system variable.
Still needs work for better layout in alert emails.

  • XaviP committed f69de10 on 7.x-1.x
    Issue #2663206: Email alerts in html with table layout and more info.
    
XaviP’s picture

Status: Active » Needs review

  • XaviP committed 9c93554 on 7.x-1.x
    Issue #2663206: Corrected typo in periodical offers email alert.
    
XaviP’s picture

Version: 7.x-1.3 » 7.x-1.6
Issue summary: View changes
Status: Needs review » Fixed

Corrected typos in offers periodical email alert.
Marking as Fixed as it seems ok now. Please reopen if any problem.

Status: Fixed » Closed (fixed)

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