Answers.Body: <p>The main issue seems to be the <code>&lt;style&gt;</code> tag defined in the templates. Schedule Reminder uses <a href="https://github.com/civicrm/civicrm-core/blob/master/CRM/Core/BAO/ActionSchedule.php#L655" rel="nofollow noreferrer">smarty engine by default</a> which strips down the css styles defined.</p>
  
  <p>This doesn't occur in CiviMail because Smarty is disabled in civicrm.settings.php. If <code>CIVICRM_MAIL_SMARTY</code> is set to 1, civimail will too see this error.</p>
  
  <p>As Smarty processing is done, escape the  tag within {literal}. Something like:</p>
  
  <pre><code>{literal}
    &lt;style&gt;........&lt;/style&gt;
  {/literal}
  .
  .
  .
  (further html code)
  </code></pre>
  
  <p>See - <a href="http://www.smarty.net/docs/en/language.escaping.tpl" rel="nofollow noreferrer">http://www.smarty.net/docs/en/language.escaping.tpl</a>.</p>
  
  <p><code>To avoid the {literal} statements being displayed in the email's wysiwyg view you can enclose those {literal} statements in a &lt;p&gt; tag with class or style to make them hidden - eg &lt;p style="display:none;"&gt;.</code></p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-03-30T14:39:49.107Z
Answers.Text: This is a brilliant solution. One tiny drawback is that the {literal} statements will be displayed in the email's wysiwyg view. So to further improve it, Jitendra suggested enclosing those {literal} statements in a <p> tag with class or style to make them hidden - eg <p style="display:none;">.
Answers.UserDisplayName: Andyg8
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-04-01T19:53:14.127Z
Answers.Text: i added that to the answer itself
Answers.UserDisplayName: petednz - fuzion
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-03-30T11:01:11.220Z
Answers.LastActivityDate: 2017-04-01T19:52:53.270Z
Answers.LastEditDate: 2017-04-01T19:52:53.270Z
Answers.UserDisplayName: jitendra - fuzion
Body: <p>I'm hoping to use email templates in Scheduled reminders that have css in a <code>&lt;style&gt;</code> tag at the start of the email. Declaring css here for html elements and classes makes MUCH more robust templates that aren't prone to disasters from click-happy admin teams deleting in-line styles.</p>
  
  <p>I can use these templates effectively in CiviMail and when sending emails directly from a contact's summary screen. </p>
  
  <p>However, the Scheduled reminders engine strips out all the css attributes in the initial <code>&lt;style&gt;</code> tag. So the email looks awful and the <code>&lt;style&gt;</code> declaration contains all the tags and classes - with no actual css!</p>
  
  <p>I'm guessing this is perhaps something to do with the IDS? I don't see any IDS log errors though. If it is something that we can tell the IDS to ignore, I'd be grateful to know how to do this. </p>
  
  <p>Or is there some other way we can tell the Scheduled reminder system not to strip those attributes?</p>
  
  <p>I'm using 4.6.24 with Drupal 7.54 and CKEditor. Note that the styles aren't being stripped by CK Editor (I've adjusted the editor's config.js to make this possible), because they work perfectly well in CiviMail and from a contact's summary screen... and they are there safely inside the Scheduled reminder email CKEditor screen.</p>
  
  <p>Perhaps it may be useful to add here that I'm not using a <code>&lt;head&gt;</code> tag to contain my <code>&lt;style&gt;</code> tag. In my config I haven't been able to persuade CKEDitor to retain the <code>&lt;head&gt;</code> tags. Nevertheless even so all is well for the other email scenarios.</p>
  
  <p>One final point - I'm aware of how to skip IDS using the following method. So could possibly add an extra path to skip in this:
  <a href="https://github.com/teamsinger/uk.teamsinger.civicrm.mailgun#user-content-skip-ids-checks" rel="nofollow noreferrer">https://github.com/teamsinger/uk.teamsinger.civicrm.mailgun#user-content-skip-ids-checks</a></p>
  
  <p>Thanks for your help.</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-03-12T22:29:34.970Z
Comments.Text: random thought, could be a red herring: might be worth checking whether there is any smarty processing stuff happening as that can strip out css stuff (as it looks similar to smarty tags)
Comments.UserDisplayName: michaelmcandrew
Tags: <email><scheduled-reminders>
Title: Scheduled reminders - Email head css attributes are being stripped out
ThreadText: # Scheduled reminders - Email head css attributes are being stripped out
  
  (Asked by: username_0 on 2017-03-10)
  
  I'm hoping to use email templates in Scheduled reminders that have css in a
  
  **Tags:** email, scheduled-reminders
  
  > **Comments:**
  > **username_1**: random thought, could be a red herring: might be worth checking whether there is any smarty processing stuff happening as that can strip out css stuff (as it looks similar to smarty tags)  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2017-03-30. Score: 5 | Accepted answer
  
  The main issue seems to be the `{/literal}
  .
  .
  .
  (further html code)`
  
  See - <http://www.smarty.net/docs/en/language.escaping.tpl>.
  
  `To avoid the {literal} statements being displayed in the email's wysiwyg view you can enclose those {literal} statements in a
  
  tag with class or style to make them hidden - eg
  
  .`
  
  > **Comments:**
  > **username_0**: This is a brilliant solution. One tiny drawback is that the {literal} statements will be displayed in the email's wysiwyg view. So to further improve it, Jitendra suggested enclosing those {literal} statements in a <p> tag with class or style to make them hidden - eg <p style="display:none;">.  
  > **username_3**: i added that to the answer itself  
  
  ---
  
  