/bp-templates/bp-legacy/buddypress/assets/emails/single-bp-email.php

  1. <?php 
  2. /** 
  3. * BuddyPress email template. 
  4. * 
  5. * Magic numbers: 
  6. * 1.618 = golden mean. 
  7. * 1.35 = default body_text_size multipler. Gives default heading of 20px. 
  8. * 
  9. * @since 2.5.0 
  10. * 
  11. * @package BuddyPress 
  12. * @subpackage Core 
  13. */ 
  14.  
  15. /** 
  16. Based on the Cerberus "Fluid" template by Ted Goas (http://tedgoas.github.io/Cerberus/). 
  17. License for the original template: 
  18.   
  19.   
  20. The MIT License (MIT) 
  21.   
  22. Copyright (c) 2013 Ted Goas 
  23.   
  24. Permission is hereby granted, free of charge, to any person obtaining a copy of 
  25. this software and associated documentation files (the "Software"), to deal in 
  26. the Software without restriction, including without limitation the rights to 
  27. use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 
  28. the Software, and to permit persons to whom the Software is furnished to do so,  
  29. subject to the following conditions: 
  30.   
  31. The above copyright notice and this permission notice shall be included in all 
  32. copies or substantial portions of the Software. 
  33.   
  34. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
  35. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 
  36. FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 
  37. COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 
  38. IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 
  39. CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 
  40. */ 
  41.  
  42. // Exit if accessed directly. 
  43. defined( 'ABSPATH' ) || exit; 
  44.  
  45. $settings = bp_email_get_appearance_settings(); 
  46.  
  47. ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
  48. <html xmlns="http://www.w3.org/1999/xhtml"> 
  49. <head> 
  50. <meta charset="<?php echo esc_attr( get_bloginfo( 'charset' ) ); ?>"> 
  51. <meta name="viewport" content="width=device-width"> <!-- Forcing initial-scale shouldn't be necessary --> 
  52. <meta http-equiv="X-UA-Compatible" content="IE=edge"> <!-- Use the latest (edge) version of IE rendering engine --> 
  53.  
  54. <!-- CSS Reset --> 
  55. <style type="text/css"> 
  56. /* What it does: Remove spaces around the email design added by some email clients. */ 
  57. /* Beware: It can remove the padding / margin and add a background color to the compose a reply window. */ 
  58. html,  
  59. body { 
  60. Margin: 0 !important; 
  61. padding: 0 !important; 
  62. height: 100% !important; 
  63. width: 100% !important; 
  64.  
  65. /* What it does: Stops email clients resizing small text. */ 
  66. * { 
  67. -ms-text-size-adjust: 100%; 
  68. -webkit-text-size-adjust: 100%; 
  69.  
  70. /* What it does: Forces Outlook.com to display emails full width. */ 
  71. .ExternalClass { 
  72. width: 100%; 
  73.  
  74. /* What is does: Centers email on Android 4.4 */ 
  75. div[style*="margin: 16px 0"] { 
  76. margin: 0 !important; 
  77.  
  78. /* What it does: Stops Outlook from adding extra spacing to tables. */ 
  79. table,  
  80. td { 
  81. mso-table-lspace: 0pt !important; 
  82. mso-table-rspace: 0pt !important; 
  83.  
  84. /* What it does: Fixes webkit padding issue. Fix for Yahoo mail table alignment bug. Applies table-layout to the first 2 tables then removes for anything nested deeper. */ 
  85. table { 
  86. border-spacing: 0 !important; 
  87. border-collapse: collapse !important; 
  88. table-layout: fixed !important; 
  89. Margin: 0 auto !important; 
  90. table table table { 
  91. table-layout: auto; 
  92.  
  93. /* What it does: Uses a better rendering method when resizing images in IE. */ 
  94. /* & manages img max widths to ensure content body images don't exceed template width. */ 
  95. img { 
  96. -ms-interpolation-mode:bicubic; 
  97. height: auto; 
  98. max-width: 100%; 
  99.  
  100. /* What it does: Overrides styles added when Yahoo's auto-senses a link. */ 
  101. .yshortcuts a { 
  102. border-bottom: none !important; 
  103.  
  104. /* What it does: A work-around for iOS meddling in triggered links. */ 
  105. a[x-apple-data-detectors] { 
  106. color: inherit !important; 
  107. text-decoration: underline !important; 
  108. </style> 
  109.  
  110. </head> 
  111. <body class="email_bg" width="100%" height="100%" bgcolor="<?php echo esc_attr( $settings['email_bg'] ); ?>" style="Margin: 0;"> 
  112. <table cellpadding="0" cellspacing="0" border="0" height="100%" width="100%" bgcolor="<?php echo esc_attr( $settings['email_bg'] ); ?>" style="border-collapse:collapse;" class="email_bg"><tr><td valign="top"> 
  113. <center style="width: 100%;"> 
  114.  
  115. <!-- Visually Hidden Preheader Text : BEGIN --> 
  116. <div style="display: none; font-size: 1px; line-height: 1px; max-height: 0px; max-width: 0px; opacity: 0; overflow: hidden; mso-hide: all; font-family: sans-serif;"> 
  117. {{email.preheader}} 
  118. </div> 
  119. <!-- Visually Hidden Preheader Text : END --> 
  120.  
  121. <div style="max-width: 600px;"> 
  122. <!--[if (gte mso 9)|(IE)]> 
  123. <table cellspacing="0" cellpadding="0" border="0" width="600" align="center"> 
  124. <tr> 
  125. <td> 
  126. <![endif]--> 
  127.  
  128. <!-- Email Header : BEGIN --> 
  129. <table cellspacing="0" cellpadding="0" border="0" align="center" width="100%" style="max-width: 600px; border-top: 7px solid <?php echo esc_attr( $settings['highlight_color'] ); ?>" bgcolor="<?php echo esc_attr( $settings['header_bg'] ); ?>" class="header_bg"> 
  130. <tr> 
  131. <td style="text-align: center; padding: 15px 0; font-family: sans-serif; mso-height-rule: exactly; font-weight: bold; color: <?php echo esc_attr( $settings['header_text_color'] ); ?>; font-size: <?php echo esc_attr( $settings['header_text_size'] . 'px' ); ?>" class="header_text_color header_text_size"> 
  132. <?php 
  133. /** 
  134. * Fires before the display of the email template header. 
  135. * 
  136. * @since 2.5.0 
  137. */ 
  138. do_action( 'bp_before_email_header' ); 
  139.  
  140. echo bp_get_option( 'blogname' ); 
  141.  
  142. /** 
  143. * Fires after the display of the email template header. 
  144. * 
  145. * @since 2.5.0 
  146. */ 
  147. do_action( 'bp_after_email_header' ); 
  148. ?> 
  149. </td> 
  150. </tr> 
  151. </table> 
  152. <!-- Email Header : END --> 
  153.  
  154. <!-- Email Body : BEGIN --> 
  155. <table cellspacing="0" cellpadding="0" border="0" align="center" bgcolor="<?php echo esc_attr( $settings['body_bg'] ); ?>" width="100%" style="max-width: 600px; border-radius: 5px;" class="body_bg"> 
  156.  
  157. <!-- 1 Column Text : BEGIN --> 
  158. <tr> 
  159. <td> 
  160. <table cellspacing="0" cellpadding="0" border="0" width="100%"> 
  161. <tr> 
  162. <td style="padding: 20px; font-family: sans-serif; mso-height-rule: exactly; line-height: <?php echo esc_attr( floor( $settings['body_text_size'] * 1.618 ) . 'px' ) ?>; color: <?php echo esc_attr( $settings['body_text_color'] ); ?>; font-size: <?php echo esc_attr( $settings['body_text_size'] . 'px' ); ?>" class="body_text_color body_text_size"> 
  163. <span style="font-weight: bold; font-size: <?php echo esc_attr( floor( $settings['body_text_size'] * 1.35 ) . 'px' ); ?>" class="welcome"><?php bp_email_the_salutation( $settings ); ?></span> 
  164. <hr color="<?php echo esc_attr( $settings['email_bg'] ); ?>"><br> 
  165. {{{content}}} 
  166. </td> 
  167. </tr> 
  168. </table> 
  169. </td> 
  170. </tr> 
  171. <!-- 1 Column Text : BEGIN --> 
  172.  
  173. </table> 
  174. <!-- Email Body : END --> 
  175.  
  176. <!-- Email Footer : BEGIN --> 
  177. <br> 
  178. <table cellspacing="0" cellpadding="0" border="0" align="left" width="100%" style="max-width: 600px; border-radius: 5px;" bgcolor="<?php echo esc_attr( $settings['footer_bg'] ); ?>" class="footer_bg"> 
  179. <tr> 
  180. <td style="padding: 20px; width: 100%; font-size: <?php echo esc_attr( $settings['footer_text_size'] . 'px' ); ?>; font-family: sans-serif; mso-height-rule: exactly; line-height: <?php echo esc_attr( floor( $settings['footer_text_size'] * 1.618 ) . 'px' ) ?>; text-align: left; color: <?php echo esc_attr( $settings['footer_text_color'] ); ?>;" class="footer_text_color footer_text_size"> 
  181. <?php 
  182. /** 
  183. * Fires before the display of the email template footer. 
  184. * 
  185. * @since 2.5.0 
  186. */ 
  187. do_action( 'bp_before_email_footer' ); 
  188. ?> 
  189.  
  190. <span class="footer_text"><?php echo nl2br( stripslashes( $settings['footer_text'] ) ); ?></span> 
  191. <br><br> 
  192. <a href="{{{unsubscribe}}}" style="text-decoration: underline;"><?php _ex( 'unsubscribe', 'email', 'buddypress' ); ?></a> 
  193.  
  194. <?php 
  195. /** 
  196. * Fires after the display of the email template footer. 
  197. * 
  198. * @since 2.5.0 
  199. */ 
  200. do_action( 'bp_after_email_footer' ); 
  201. ?> 
  202. </td> 
  203. </tr> 
  204. </table> 
  205. <!-- Email Footer : END --> 
  206.  
  207. <!--[if (gte mso 9)|(IE)]> 
  208. </td> 
  209. </tr> 
  210. </table> 
  211. <![endif]--> 
  212. </div> 
  213. </center> 
  214. </td></tr></table> 
  215. <?php if ( function_exists( 'is_customize_preview' ) && is_customize_preview() ) wp_footer(); ?> 
  216. </body> 
  217. </html> 
.