[ Index ]

PHP Cross Reference of BuddyPress

title

Body

[close]

/src/bp-templates/bp-legacy/buddypress/assets/emails/ -> single-bp-email.php (source)

   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   * @version 3.0.0
  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="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">
 191                                      <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>
 192                                      <hr color="<?php echo esc_attr( $settings['email_bg'] ); ?>">
 193                                      {{{content}}}
 194                                  </td>
 195                              </tr>
 196                          </table>
 197                      </td>
 198                  </tr>
 199                  <!-- 1 Column Text : BEGIN -->
 200  
 201              </table>
 202              <!-- Email Body : END -->
 203  
 204              <!-- Email Footer : BEGIN -->
 205              <br>
 206              <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">
 207                  <tr>
 208                      <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">
 209                          <?php
 210                          /**
 211                           * Fires before the display of the email template footer.
 212                           *
 213                           * @since 2.5.0
 214                           */
 215                          do_action( 'bp_before_email_footer' );
 216                          ?>
 217  
 218                          <span class="footer_text"><?php echo nl2br( stripslashes( $settings['footer_text'] ) ); ?></span>
 219                          <br><br>
 220                          <a href="{{{unsubscribe}}}" style="text-decoration: underline;"><?php _ex( 'unsubscribe', 'email', 'buddypress' ); ?></a>
 221  
 222                          <?php
 223                          /**
 224                           * Fires after the display of the email template footer.
 225                           *
 226                           * @since 2.5.0
 227                           */
 228                          do_action( 'bp_after_email_footer' );
 229                          ?>
 230                      </td>
 231                  </tr>
 232              </table>
 233              <!-- Email Footer : END -->
 234  
 235              <!--[if mso]>
 236              </td>
 237              </tr>
 238              </table>
 239              <![endif]-->
 240          </div>
 241      </center>
 242  </td></tr></table>
 243  <?php if ( function_exists( 'is_customize_preview' ) && is_customize_preview() ) wp_footer(); ?>
 244  </body>
 245  </html>


Generated: Tue Oct 15 01:00:54 2024 Cross-referenced by PHPXref 0.7.1