b2evolution PHP Cross Reference Blogging Systems

Source: /skins_email/contact_message_new.txt.php - 98 lines - 3823 bytes - Text - Print

Description: This is sent to a ((User)) or ((BlogOwner)) when someone sends them a message through a contact form (which is called from a comment, footer of blog, etc.)

   1  <?php
   2  /**
   3   * This is sent to a ((User)) or ((BlogOwner)) when someone sends them a message through a contact form (which is called from a comment, footer of blog, etc.)
   4   *
   5   * For more info about email skins, see: http://b2evolution.net/man/themes-templates-skins/email-skins/
   6   *
   7   * b2evolution - {@link http://b2evolution.net/}
   8   * Released under GNU GPL License - {@link http://b2evolution.net/about/license.html}
   9   * @copyright (c)2003-2014 by Francois Planque - {@link http://fplanque.com/}
  10   *
  11   * @version $Id: contact_message_new.txt.php 6136 2014-03-08 07:59:48Z manuel $
  12   */
  13  if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' );
  14  
  15  // ---------------------------- EMAIL HEADER INCLUDED HERE ----------------------------
  16  emailskin_include( '_email_header.inc.txt.php', $params );
  17  // ------------------------------- END OF EMAIL HEADER --------------------------------
  18  
  19  global $htsrv_url, $samedomain_htsrv_url;
  20  
  21  // Default params:
  22  $params = array_merge( array(
  23          'sender_name'      => '',
  24          'sender_address'   => '',
  25          'message_footer'   => '',
  26          'Blog'             => NULL,
  27          'message'          => '',
  28          'comment_id'       => NULL,
  29          'post_id'          => NULL,
  30          'recipient_User'   => NULL,
  31          'Comment'          => NULL,
  32      ), $params );
  33  
  34  
  35  $Blog = $params['Blog'];
  36  
  37  // show sender name
  38  echo sprintf( T_('%s has sent you this message:'), $params['sender_name'] )."\n\n";
  39  
  40  echo $params['message'];
  41  echo "\n\n-- \n";
  42  
  43  // show sender email address
  44  echo sprintf( T_( 'By replying, your email will go directly to %s.' ), $params['sender_address'] );
  45  
  46  // show additional message info
  47  if( !empty( $Blog ) )
  48  {
  49      if( !empty( $params['comment_id'] ) )
  50      {
  51          echo "\n\n".T_('Message sent from your comment:') . "\n"
  52              .url_add_param( $Blog->get('url'), 'p='.$params['post_id'].'#'.$params['comment_id'], '&' );
  53      }
  54      elseif( !empty( $params['post_id'] ) )
  55      {
  56          echo "\n\n".T_('Message sent from your post:') . "\n"
  57              .url_add_param( $Blog->get('url'), 'p='.$params['post_id'], '&' );
  58      }
  59      else
  60      {
  61          echo "\n\n".sprintf( T_('Message sent through the contact form on %s.'), $Blog->get('shortname') ). "\n";
  62  
  63      }
  64  }
  65  
  66  if( !empty( $params['recipient_User'] ) )
  67  { // Member:
  68      global $Settings;
  69      if( $Settings->get( 'emails_msgform' ) == 'userset' )
  70      { // user can allow/deny to receive emails
  71          $edit_preferences_url = NULL;
  72          if( !empty( $Blog ) )
  73          { // go to blog
  74              $edit_preferences_url = url_add_param( str_replace( '&amp;', '&', $Blog->gen_blogurl() ), 'disp=userprefs', '&' );
  75          }
  76          elseif( $params['recipient_User']->check_perm( 'admin', 'restricted' ) )
  77          { // go to admin
  78              $edit_preferences_url = $admin_url.'?ctrl=user&user_tab=userprefs&user_ID='.$params['recipient_User']->ID;
  79          }
  80          if( !empty( $edit_preferences_url ) )
  81          { // add edit preferences link
  82              echo "\n\n".T_('You can edit your profile to not receive emails through a form:')."\n".$edit_preferences_url."\n";
  83          }
  84      }
  85      // Add quick unsubcribe link so users can deny receiving emails through b2evo message form in any circumstances
  86      $params['unsubscribe_text'] = T_( 'If you don\'t want to receive any more emails through a message form, click here:' ).' '.
  87          $htsrv_url.'quick_unsubscribe.php?type=msgform&user_ID=$user_ID$&key=$unsubscribe_key$';
  88  }
  89  elseif( !empty( $params['Comment'] ) )
  90  { // Visitor:
  91      $params['unsubscribe_text'] = T_("Click on the following link to not receive e-mails on your comments\nfor this e-mail address anymore:").' '.
  92          $samedomain_htsrv_url.'anon_unsubscribe.php?type=comment&c='.$params['Comment']->ID.'&anon_email='.rawurlencode( $params['Comment']->author_email );
  93  }
  94  
  95  // ---------------------------- EMAIL FOOTER INCLUDED HERE ----------------------------
  96  emailskin_include( '_email_footer.inc.txt.php', $params );
  97  // ------------------------------- END OF EMAIL FOOTER --------------------------------
  98  ?>

title

Description

title

Description

title

Description

title

title

Body