My users tend to be older and the default email is too "hard to read" for many of them. I have been working with the webform_mail.tpl.php file and looking through the documentation... but I'm still struggling to make this work.

I want to make the font larger (just placing font size tags around the php snippets had no affect) and I want to be able to bold the labels only, not the submitted data.

Does anyone know how to accomplish this?

Thanks in advance!

Comments

quicksketch’s picture

Webform's e-mails are all plain text, so you can't include HTML in them without a little extra effort. You might notice that any HTML you put in webform-mail.tpl.php does not render as HTML, it just shows up as plain text. This is because all e-mail is assumed to be plain text unless specified as something else. In order to include HTML in the e-mail, you also need to override the theme function theme_webform_email_headers(). Using this, you can add the appropriate e-mail header declaring that the e-mail is HTML instead of plain text.

function mytheme_webform_mail_headers($form_values, $node, $sid, $cid) {
  $headers = array(
    'MIME-Version' => '1.0',
    'Content-type' => 'text/html; charset="iso-8859-1"',
  );
  return $headers;
}

I haven't tested this so I'm not sure what you'll experience. You might need to do some research on the proper headers to include in the e-mail.

thijsvdanker’s picture

works like a charm for me, thanks quicksketch!

webwriter’s picture

Sorry to be dense but I'm not clicking on all cylinders today... where does this php code go exactly?

Thanks!

quicksketch’s picture

Title: Format Labels for Email » Format Labels with HTML for Email
Status: Active » Closed (fixed)

This code goes in template.php in your site's current theme. Be sure to replace "mytheme" with the name of your theme after pasting it into template.php. Closing after lack of activity.