Advertisement
Guest User

BP email template

a guest
Jul 25th, 2020
1,833
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.84 KB | None | 0 0
  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. * @version 3.1.0
  11. *
  12. * @package BuddyPress
  13. * @subpackage Core
  14. */
  15.  
  16. /*
  17. Based on the Cerberus "Fluid" template by Ted Goas (http://tedgoas.github.io/Cerberus/).
  18. License for the original template:
  19.  
  20.  
  21. The MIT License (MIT)
  22.  
  23. Copyright (c) 2017 Ted Goas
  24.  
  25. Permission is hereby granted, free of charge, to any person obtaining a copy of
  26. this software and associated documentation files (the "Software"), to deal in
  27. the Software without restriction, including without limitation the rights to
  28. use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
  29. the Software, and to permit persons to whom the Software is furnished to do so,
  30. subject to the following conditions:
  31.  
  32. The above copyright notice and this permission notice shall be included in all
  33. copies or substantial portions of the Software.
  34.  
  35. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  36. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
  37. FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
  38. COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
  39. IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  40. CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  41. */
  42.  
  43. // Exit if accessed directly.
  44. defined( 'ABSPATH' ) || exit;
  45.  
  46. $settings = bp_email_get_appearance_settings();
  47.  
  48. ?><!DOCTYPE html>
  49. <html lang="en" xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">
  50. <head>
  51. <meta charset="<?php echo esc_attr( get_bloginfo( 'charset' ) ); ?>">
  52. <meta name="viewport" content="width=device-width"> <!-- Forcing initial-scale shouldn't be necessary -->
  53. <meta http-equiv="X-UA-Compatible" content="IE=edge"> <!-- Use the latest (edge) version of IE rendering engine -->
  54. <meta name="x-apple-disable-message-reformatting"> <!-- Disable auto-scale in iOS 10 Mail entirely -->
  55. <title></title> <!-- The title tag shows in email notifications, like Android 4.4. -->
  56.  
  57. <!-- CSS Reset -->
  58. <style type="text/css">
  59. /* What it does: Remove spaces around the email design added by some email clients. */
  60. /* Beware: It can remove the padding / margin and add a background color to the compose a reply window. */
  61. html,
  62. body {
  63. Margin: 0 !important;
  64. padding: 0 !important;
  65. height: 100% !important;
  66. width: 100% !important;
  67. }
  68.  
  69. /* What it does: Stops email clients resizing small text. */
  70. * {
  71. -ms-text-size-adjust: 100%;
  72. -webkit-text-size-adjust: 100%;
  73. }
  74.  
  75. /* What is does: Centers email on Android 4.4 */
  76. div[style*="margin: 16px 0"] {
  77. margin: 0 !important;
  78. }
  79.  
  80. /* What it does: Stops Outlook from adding extra spacing to tables. */
  81. table,
  82. td {
  83. mso-table-lspace: 0pt !important;
  84. mso-table-rspace: 0pt !important;
  85. }
  86.  
  87. /* 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. */
  88. table {
  89. border-spacing: 0 !important;
  90. border-collapse: collapse !important;
  91. table-layout: fixed !important;
  92. Margin: 0 auto !important;
  93. }
  94. table table table {
  95. table-layout: auto;
  96. }
  97.  
  98. /* What it does: Uses a better rendering method when resizing images in IE. */
  99. /* & manages img max widths to ensure content body images don't exceed template width. */
  100. img {
  101. -ms-interpolation-mode:bicubic;
  102. height: auto;
  103. max-width: 100%;
  104. }
  105.  
  106. /* What it does: A work-around for email clients meddling in triggered links. */
  107. *[x-apple-data-detectors], /* iOS */
  108. .x-gmail-data-detectors, /* Gmail */
  109. .x-gmail-data-detectors *,
  110. .aBn {
  111. border-bottom: 0 !important;
  112. cursor: default !important;
  113. color: inherit !important;
  114. text-decoration: none !important;
  115. font-size: inherit !important;
  116. font-family: inherit !important;
  117. font-weight: inherit !important;
  118. line-height: inherit !important;
  119. }
  120.  
  121. /* What it does: Prevents Gmail from displaying an download button on large, non-linked images. */
  122. .a6S {
  123. display: none !important;
  124. opacity: 0.01 !important;
  125. }
  126.  
  127. /* If the above doesn't work, add a .g-img class to any image in question. */
  128. img.g-img + div {
  129. display: none !important;
  130. }
  131.  
  132. /* What it does: Prevents underlining the button text in Windows 10 */
  133. .button-link {
  134. text-decoration: none !important;
  135. }
  136. </style>
  137.  
  138. </head>
  139. <body class="email_bg" width="100%" bgcolor="<?php echo esc_attr( $settings['email_bg'] ); ?>" style="margin: 0; mso-line-height-rule: exactly;">
  140. <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">
  141. <center style="width: 100%; text-align: <?php echo esc_attr( $settings['direction'] ); ?>;">
  142.  
  143. <!-- Visually Hidden Preheader Text : BEGIN -->
  144. <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;">
  145. {{email.preheader}}
  146. </div>
  147. <!-- Visually Hidden Preheader Text : END -->
  148.  
  149. <div style="max-width: 600px; margin: auto;" class="email-container">
  150. <!--[if mso]>
  151. <table role="presentation" cellspacing="0" cellpadding="0" border="0" width="600" align="center">
  152. <tr>
  153. <td>
  154. <![endif]-->
  155.  
  156. <!-- Email Header : BEGIN -->
  157. <table role="presentation" 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">
  158. <tr>
  159. <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">
  160. <?php
  161. /**
  162. * Fires before the display of the email template header.
  163. *
  164. * @since 2.5.0
  165. */
  166. do_action( 'bp_before_email_header' );
  167.  
  168. echo bp_get_option( 'blogname' );
  169.  
  170. /**
  171. * Fires after the display of the email template header.
  172. *
  173. * @since 2.5.0
  174. */
  175. do_action( 'bp_after_email_header' );
  176. ?>
  177. </td>
  178. </tr>
  179. </table>
  180. <!-- Email Header : END -->
  181.  
  182. <!-- Email Body : BEGIN -->
  183. <table role="presentation" 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">
  184.  
  185. <!-- 1 Column Text : BEGIN -->
  186. <tr>
  187. <td>
  188. <table role="presentation" cellspacing="0" cellpadding="0" border="0" width="100%">
  189. <tr>
  190. <td style="line-height: 32px; padding: 10px;" valign="baseline">
  191. <p><a href="https://historielaerer.dk"><img src="https://historielaerer.dk/wp-content/uploads/2014/05/HLF_logo_farve_pos-stor.png" alt="logo" width="590" align="middle" /></a></p>
  192. </td>
  193. </tr>
  194. <tr>
  195. <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">
  196. <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>
  197. <hr color="<?php echo esc_attr( $settings['email_bg'] ); ?>">
  198. {{{content}}}
  199. </td>
  200. </tr>
  201.  
  202.  
  203. </tr>
  204. </table>
  205. </td>
  206. </tr>
  207. <!-- 1 Column Text : BEGIN -->
  208.  
  209. </table>
  210. <!-- Email Body : END -->
  211.  
  212. <!-- Email Footer : BEGIN -->
  213. <br>
  214. <table role="presentation" cellspacing="0" cellpadding="0" border="0" align="<?php echo esc_attr( $settings['direction'] ); ?>" width="100%" style="max-width: 600px; border-radius: 5px;" bgcolor="<?php echo esc_attr( $settings['footer_bg'] ); ?>" class="footer_bg">
  215. <tr>
  216. <tr>
  217. <strong>Kursusreklame: Hvad er problemet? Tilmelding senest 8/9 2020</strong></center><center><strong><br /></strong><a href="https://historielaerer.dk/kurser/hvad-er-problemet/"><img src="https://historielaerer.dk/wp-content/uploads/2020/02/ProblemSolveropt.jpg" width="100%" align="middle" /></a>
  218. </tr>
  219. <tr>
  220. <td style="border-top: solid 1px #d9d9d9; padding: 15px;" colspan="2"><a href="https://historielaerer.dk/kurser/">Kursuskalender</a> | <a href="https://historielaerer.dk/fora/">Videndeling</a> | <a href="https://historielaerer.dk/historielaerer-dk/">Om historielaerer.dk</a><br/>Du modtager denne mail, fordi du har en brugerkonto på historielaerer.dk - du kan ændre dine mailpræferencer i din profil.</td>
  221. </tr>
  222. <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: <?php echo esc_attr( $settings['direction'] ); ?>; color: <?php echo esc_attr( $settings['footer_text_color'] ); ?>; word-break: break-all;" class="footer_text_color footer_text_size">
  223. <?php
  224. /**
  225. * Fires before the display of the email template footer.
  226. *
  227. * @since 2.5.0
  228. */
  229. do_action( 'bp_before_email_footer' );
  230. ?>
  231.  
  232. <span class="footer_text"><?php echo nl2br( stripslashes( $settings['footer_text'] ) ); ?></span>
  233. <br><br>
  234.  
  235. <a href="{{{unsubscribe}}}" style="text-decoration: underline;"><?php echo esc_html_x( 'unsubscribe', 'email', 'buddypress' ); ?></a>
  236.  
  237. <?php
  238. /**
  239. * Fires after the display of the email template footer.
  240. *
  241. * @since 2.5.0
  242. */
  243. do_action( 'bp_after_email_footer' );
  244. ?>
  245. </td>
  246. </tr>
  247. </table>
  248. <!-- Email Footer : END -->
  249.  
  250. <!--[if mso]>
  251. </td>
  252. </tr>
  253. </table>
  254. <![endif]-->
  255. </div>
  256. </center>
  257. </td></tr></table>
  258. <?php
  259. if ( function_exists( 'is_customize_preview' ) && is_customize_preview() ) {
  260. wp_footer();
  261. }
  262. ?>
  263. </body>
  264. </html>
  265.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement