the Registrations can send HTML E-mail to registres?
how can do?
thanks.

Comments

darkfirzenmax created an issue.

rudiedirkx’s picture

Enable Mime Mail? That will send HTML mail.

Or do you want the textareas to be WYSIWYGs?

hanskuiters’s picture

I need this too. Installed htmlmail module. Works fine, the received mail message is in html format.

The textfield doesn't show the wysiwyg editor yet. For that I use a form alter, changing the field type from 'textarea' to 'text_format'.

But that throws an error. Caused by the fact that the form alter makes an array of $form_state['values']['message'] instead of a single value. So I added an additional validation handler to the form. Below the complete code.

function MYMODULE_form_alter(&$form, &$form_state, $form_id) {
  if ($form_id == 'node_registration_registrations_broadcast_form') {
    $form['message']['#type'] = 'text_format';
    $form['#validate'][] = 'MYMODULE_form_validator';
  }
}


function MYMODULE_form_validator(&$form, &$form_state) {
  $form_state['values']['message'] = $form_state['values']['message']['value'];
}
rudiedirkx’s picture

More correct would be

$form_state['values']['message'] = check_markup($form_state['values']['message']['value'], $form_state['values']['message']['format']);

because that's what the format is for: to run filters, and check_markup() does that.

hanskuiters’s picture

That IS correct, thanks.