CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviMail (Moderator: Piotr Szotkowski) »
  • HTML Email <head> elements
Pages: [1]

Author Topic: HTML Email <head> elements  (Read 899 times)

m4olivei

  • I post occasionally
  • **
  • Posts: 39
  • Karma: 2
  • CiviCRM version: 4.3.5
  • CMS version: Drupal 7.23
  • MySQL version: MySQL 5
  • PHP version: PHP 5.3
HTML Email <head> elements
October 30, 2013, 08:31:52 am
Hello,

I'm creating an email template for a client that uses CiviMail to send out newsletters.  Best practice for email newsletters includes having some style in the <head> element of the HTML email for clients that read it.  Using the WYSIWYG editor (tinyMCE) in the Message Templates area of CiviCRM, how do I get <head> elements to pass through?

I'm almost 100% positive that its TinyMCE that is stripping the tags, not CiviCRM.  To that end, how do I adjust the tinymce.init settings that CiviCRM must write out somewhere?  I think I even found the place where these are output, on Drupal + CiviCRM 4.3.5 it's at civicrm/packages/HTML/QuickForm/tinymce.php in HTML_QuickForm_TinyMCE::toHTML() line 148.  At the end, it looks like whoever built this left in a stub for putting custom TinyMCE settings: $this->getConfigString().  How do I use that?  Hoping I don't have to patch this.

Thanks,
Matt

Owen

  • I post occasionally
  • **
  • Posts: 83
  • Karma: 2
    • Leukaemia & Lymphoma Research
  • CiviCRM version: 4.3.4
  • CMS version: Drupal 7
  • MySQL version: -
  • PHP version: -
Re: HTML Email <head> elements
October 30, 2013, 09:07:36 am
An alternative :

Put this :

<html>
<head> </head>
<body>

in the CiviCRM email template 'header', then the body of the email in the template and

</body>
</html>

in the footer. Header and footer never get loaded into the wysywyg so don't' get stripped of<head> and <body> tags

m4olivei

  • I post occasionally
  • **
  • Posts: 39
  • Karma: 2
  • CiviCRM version: 4.3.5
  • CMS version: Drupal 7.23
  • MySQL version: MySQL 5
  • PHP version: PHP 5.3
Re: HTML Email <head> elements
October 30, 2013, 11:31:07 am
Ahhh, that's awesome.  Thank's so much, worked like a charm!

bmw

  • I post occasionally
  • **
  • Posts: 103
  • Karma: 4
    • Alcohol Justice - The Industry Watchdog
  • CiviCRM version: 4.5.8
  • CMS version: Joomla! 3.4.0
  • MySQL version: 5.5.42-cli
  • PHP version: 5.3.27
Re: HTML Email <head> elements
November 21, 2013, 01:58:25 pm
This doesn't work for me. As soon at it hits the testing step 4, it has already stripped out the <html><head><body> tags.
Bruce Wolfe, M.S.W., CIO
Alcohol Justice, 501(c)3

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviMail (Moderator: Piotr Szotkowski) »
  • HTML Email <head> elements

This forum was archived on 2017-11-26.