[ Index ]

MailPress 544

[ Index ]     [ Classes ]     [ Functions ]     [ Variables ]     [ Constants ]     [ Statistics ]    

title

Body

[close]

/mp-content/add-ons/ -> MailPress_newsletter.php (source)

   1  <?php
   2  if (class_exists('MailPress') && !class_exists('MailPress_newsletter') )
   3  {
   4  /*
   5  Plugin Name: MailPress_newsletter
   6  Plugin URI: http://blog.mailpress.org/tutorials/add-ons/newsletter/
   7  Description: Newsletters : for posts
   8  Version: 5.4.4
   9  */
  10  
  11  class MailPress_newsletter
  12  {
  13      const meta_key = '_MailPress_newsletter';
  14      const log_name = 'newsletter';
  15  
  16  	function __construct()
  17      {
  18  // for wordpress hooks
  19  // for plugin
  20          add_action('init',     array(__CLASS__, 'init'), 99);
  21  
  22  // register form
  23          add_action('user_register',             array(__CLASS__, 'user_register'), 10, 1);
  24          add_action('MailPress_register_form',     array(__CLASS__, 'register_form'), 10);
  25  
  26  // for shortcode
  27          add_filter('MailPress_form_defaults',     array(__CLASS__, 'form_defaults'), 8, 1);
  28          add_filter('MailPress_form_options',         array(__CLASS__, 'form_options'), 8, 1);
  29          add_filter('MailPress_form_submit',         array(__CLASS__, 'form_submit'), 8, 2);
  30          add_action('MailPress_form',               array(__CLASS__, 'form'), 1, 2);
  31  
  32  // for newsletter
  33          add_action('MailPress_register_newsletter',array(__CLASS__, 'register'), 1);
  34  
  35  // for scheduling and processing newsletters
  36          add_action('mp_schedule_newsletters',     array(__CLASS__, 'schedule'), 8, 1);
  37          add_action('mp_process_newsletter',         array(__CLASS__, 'process'));
  38          add_action('mp_process_post_newsletter',     array(__CLASS__, 'process'));
  39  
  40  // for sending mails
  41          add_filter('MailPress_mailinglists_optgroup',     array(__CLASS__, 'mailinglists_optgroup'), 50, 2);
  42          add_filter('MailPress_mailinglists',             array(__CLASS__, 'mailinglists'), 50, 1);
  43          add_filter('MailPress_query_mailinglist',         array(__CLASS__, 'query_mailinglist'), 50, 2);
  44  
  45  // for sync wordpress user
  46          add_filter('MailPress_has_subscriptions', array(__CLASS__, 'has_subscriptions'), 8, 2);
  47          add_action('MailPress_sync_subscriptions',array(__CLASS__, 'sync_subscriptions'), 8, 2);    
  48  
  49  // for wp admin
  50          if (is_admin())
  51          {
  52          // install
  53              register_activation_hook(  plugin_basename(__FILE__), array(__CLASS__, 'install'));
  54              register_deactivation_hook(plugin_basename(__FILE__), array(__CLASS__, 'uninstall'));
  55          // for link on plugin page
  56              add_filter('plugin_action_links',             array(__CLASS__, 'plugin_action_links'), 10, 2 );
  57          // for role & capabilities
  58              add_filter('MailPress_capabilities',         array(__CLASS__, 'capabilities'), 1, 1);
  59          // for settings
  60              add_filter('MailPress_settings_tab',         array(__CLASS__, 'settings_tab'), 10, 1);
  61          // for settings general
  62              add_action('MailPress_settings_general',         array(__CLASS__, 'settings_general'), 30);
  63          // for settings subscriptions
  64              add_action('MailPress_settings_subscriptions',     array(__CLASS__, 'settings_subscriptions'), 30);
  65          // for settings logs
  66              add_action('MailPress_settings_logs',         array(__CLASS__, 'settings_logs'), 50);
  67          // for meta box in user page
  68              if (current_user_can('MailPress_manage_newsletters'))
  69              {
  70                  add_action('MailPress_update_meta_boxes_user',     array(__CLASS__, 'update_meta_boxes_user'));
  71                  add_action('MailPress_add_meta_boxes_user',     array(__CLASS__, 'add_meta_boxes_user'), 20, 2);
  72              }
  73          // for meta box in write post
  74              if (current_user_can('MailPress_test_newsletters'))
  75                  add_action('do_meta_boxes',                 array(__CLASS__, 'add_meta_boxes_post'), 8, 3);
  76          }
  77  
  78  // for mp_users list
  79          add_action('MailPress_users_restrict',     array(__CLASS__, 'users_restrict'), 9, 1);
  80          add_filter('MailPress_users_columns',     array(__CLASS__, 'users_columns'), 10, 1);
  81          add_action('MailPress_users_get_list',     array(__CLASS__, 'users_get_list'), 10, 2);
  82          add_action('MailPress_users_get_row',     array(__CLASS__, 'users_get_row'), 10, 3);
  83  
  84  // for ajax
  85          add_action('mp_action_mp_meta_box_post_test',     array(__CLASS__, 'mp_action_mp_meta_box_post_test'));
  86      }
  87  
  88  //// Subscriptions ////
  89  
  90  	public static function get_checklist($mp_user_id = false, $args = '') 
  91      {
  92          global $mp_subscriptions;
  93          if (!isset($mp_subscriptions['newsletters'])) return false;
  94          if (empty( $mp_subscriptions['newsletters'])) return false;
  95  
  96          $checklist = '';
  97          $defaults = array (    'htmlname'     => 'keep_newsletters', 
  98                          'admin'     => 0, 
  99                          'selected'     => false, 
 100                          'type'    => 'checkbox',
 101                          'show_option_all'  => false, 
 102                             'htmlstart'=> '', 
 103                          'htmlmiddle'=> '&#160;&#160;', 
 104                          'htmlend'    => "<br />\n"
 105                      );
 106          $r = wp_parse_args( $args, $defaults );
 107          extract( $r );
 108  
 109          $lib_nl = ($admin) ? 'admin' : 'blog';
 110  
 111          if ($mp_user_id)     $in = MP_Newsletter::get_object_terms($mp_user_id);
 112          else            $in = MP_Newsletter::get_defaults();
 113  
 114          global $mp_registered_newsletters;
 115          $nls = MP_Newsletter::get_active();
 116  
 117          foreach ($nls as $k => $v)
 118          {
 119              if ($mp_registered_newsletters[$k]['descriptions'][$lib_nl])
 120                  switch ($type)
 121                  {
 122                      case 'checkbox' :
 123                          $checked = checked(isset($in[$k]), true, false);
 124                          $_type   = 'checkbox';
 125  
 126                          $v         = $mp_registered_newsletters[$k]['descriptions'][$lib_nl];
 127  
 128                          $tag          = "<input type='$_type' id='{$htmlname}_{$k}' name='{$htmlname}[{$k}]'$checked />";
 129                          $htmlstart2  = str_replace('{{id}}', "{$htmlname}_{$k}", $htmlstart);
 130                          $htmlmiddle2 = $htmlmiddle . str_replace('&#160;', '', $v);
 131                          $htmlend2    = $htmlend;
 132  
 133                          $checklist .= "$htmlstart2$tag$htmlmiddle2$htmlend2";
 134                      break;
 135                      case 'select' :
 136                          if ($show_option_all)
 137                          {
 138                              $checklist .= "<option value=''>" . $show_option_all . "</option>\n";
 139                              $show_option_all = false;
 140                          }
 141                          $sel = ($k == $selected) ? " selected='selected'" : '';
 142                          $checklist .= "<option value=\"$k\"$sel>{$mp_registered_newsletters[$k]['descriptions'][$lib_nl]}</option>\n";
 143                      break;
 144                  }
 145          }
 146          if ('select' == $type) $checklist = "\n{$htmlstart}\n<select name='{$htmlname}'>\n{$checklist}</select>\n{$htmlend}\n";
 147  
 148          return $checklist;
 149      }
 150  
 151  	public static function update_checklist($mp_user_id, $name = 'keep_newsletters') 
 152      {
 153          MP_Newsletter::set_object_terms( $mp_user_id, $_POST[$name] );
 154      }
 155  
 156  //// Plugin ////
 157  
 158  	public static function init()
 159      {
 160          do_action('MailPress_register_newsletter');
 161          do_action('MailPress_registered_newsletters');
 162  
 163          new MP_Newsletter_schedulers();
 164      }
 165  
 166  //// Register form ////
 167  
 168  	public static function user_register($wp_user_id)
 169      {
 170          $user     = get_userdata($wp_user_id);
 171          $email     = $user->user_email;
 172          $mp_user_id    = MP_User::get_id_by_email($email);
 173                  
 174          if(!isset($_POST['keep_newsletters'])) $_POST['keep_newsletters'] = MP_Newsletter::get_defaults();
 175  
 176          self::update_checklist($mp_user_id);
 177      }
 178  
 179  	public static function register_form()
 180      {
 181          $checklist_newsletters = self::get_checklist();
 182          if (empty($checklist_newsletters)) return;
 183  ?>
 184      <br />
 185      <p>
 186          <label>
 187              <?php _e('Newsletters', MP_TXTDOM); ?>
 188              <br />
 189              <span style='color:#777;font-weight:normal;'>
 190                  <?php echo $checklist_newsletters; ?>
 191              </span>
 192          </label>
 193      </p>
 194  <?php 
 195      }
 196  
 197  //// Shortcode ////
 198  
 199  	public static function form_defaults($x) { $x['newsletter'] = false; return $x; }
 200  
 201  	public static function form_options($x)  { return $x; }
 202  
 203  	public static function form_submit($shortcode_message, $email)  
 204      { 
 205          if (!isset($_POST['newsletter']))     return $shortcode_message;
 206          if (!$_POST['newsletter'])         return $shortcode_message;
 207          $shortcode = 'shortcode_newsletters';
 208  
 209          $mp_user_id = MP_User::get_id_by_email($email);
 210          $_POST[$shortcode] = MP_Newsletter::get_object_terms($mp_user_id);
 211  
 212          $_POST[$shortcode] = array_flip(array_map(trim, explode(',', $_POST['newsletter'])));
 213  
 214          self::update_checklist($mp_user_id, $shortcode);
 215  
 216          return $shortcode_message . __('<br />Newsletters added', MP_TXTDOM);
 217      }
 218  
 219  	public static function form($email, $options)  
 220      {
 221          if (!$options['newsletter']) return;
 222  
 223          global $mp_registered_newsletters;
 224          $x = array();
 225          foreach (array_map(trim, explode(',', $options['newsletter'])) as $k => $v) if (isset($mp_registered_newsletters[$v]) && $mp_registered_newsletters[$v]['allowed']) $x[] = $v;
 226          if (empty($x)) return;
 227  
 228          echo "<input type='hidden' name='newsletter' value='" . join(', ', $x) . "' />\n";
 229      }
 230  
 231  ////  Newsletter  ////
 232  
 233  	public static function register() 
 234      {
 235          $args = array(    'root'         => MP_CONTENT_DIR . 'advanced/newsletters/post',
 236                      'root_filter'     => 'MailPress_advanced_newsletters_root',
 237                      'files'        => array('post', 'daily', 'weekly', 'monthly'),
 238  
 239                      'post_type'    => 'post',
 240          );
 241  
 242          MP_Newsletter::register_files($args);
 243      }
 244  
 245  //// Scheduling & Processing  ////
 246  
 247  	public static function schedule($args = array())
 248      {
 249          extract($args);
 250  
 251          self::unschedule_hook('mp_process_newsletter');
 252          MP_Newsletter_schedulers::schedule($event);
 253      }
 254  
 255  	public static function process($args)
 256      {
 257          extract($args);
 258  
 259          new MP_Newsletter_processors();
 260  
 261          MP_Newsletter_processors::process($newsletter);
 262      }
 263  
 264  //// Sending Mails ////
 265  
 266  	public static function mailinglists_optgroup( $label, $optgroup ) 
 267      {
 268          if (__CLASS__ == $optgroup) return __('Newsletters', MP_TXTDOM);
 269          return $label;
 270      }
 271  
 272  	public static function mailinglists( $draft_dest = array() )
 273      {
 274          $x = MP_Newsletter::get_active();
 275          foreach ($x as $k => $v) $draft_dest[__CLASS__ . '~' . $k] = $v;
 276          return $draft_dest;
 277      }
 278  
 279  	public static function query_mailinglist( $query, $draft_toemail )
 280      {
 281          if ($query) return $query;
 282  
 283          $id = str_replace(__CLASS__ . '~', '', $draft_toemail, $count);
 284          if (0 == $count) return $query;
 285          if (empty($id)) return $query;
 286  
 287          global $mp_registered_newsletters;
 288          if (!isset($mp_registered_newsletters[$id])) return $query;
 289  
 290          $in = ($mp_registered_newsletters[$id]['default']) ? 'NOT' : '';
 291  
 292          return MP_Newsletter::get_query_newsletter($id, $in);
 293      }
 294  
 295  // Sync wordpress user
 296  
 297  	public static function has_subscriptions($has, $mp_user_id)
 298      {
 299          $x = MP_Newsletter::get_object_terms($mp_user_id);
 300  
 301          if (empty($x)) return $has;
 302          return true;
 303      }
 304  
 305  	public static function sync_subscriptions($oldid, $newid)
 306      {
 307          $old = MP_Newsletter::get_object_terms($oldid);
 308          if (empty($old)) return;
 309          $new = MP_Newsletter::get_object_terms($newid);
 310  
 311          MP_Newsletter::set_object_terms($newid, array_merge($old, $new));
 312      }
 313  
 314  ////  ADMIN  ////
 315  ////  ADMIN  ////
 316  ////  ADMIN  ////
 317  ////  ADMIN  ////
 318  
 319  // install
 320  	public static function install() 
 321      {
 322          self::uninstall();
 323  
 324          $logs = get_option(MailPress::option_name_logs);
 325          if (!isset($logs[self::log_name]))
 326          {
 327              $logs[self::log_name] = MailPress::$default_option_logs;
 328              update_option(MailPress::option_name_logs, $logs );
 329          }
 330  
 331          include  (MP_ABSPATH . 'mp-admin/includes/install/newsletter.php');
 332  
 333          $now4cron = current_time('timestamp', 'gmt');
 334          wp_schedule_single_event( $now4cron - 1, 'mp_schedule_newsletters', array('args' => array('event' => '** Install **' )));
 335  
 336          $twicedaily = gmmktime(0, 0, 0, gmdate('n', $now4cron), gmdate('j', $now4cron), gmdate('Y', $now4cron)) - get_option('gmt_offset') * 3600;
 337          wp_schedule_event( $twicedaily, 'twicedaily', 'mp_schedule_newsletters', array('args' => array('event' => '** Twice daily **' )));
 338      }
 339  
 340  	public static function uninstall() 
 341      {
 342          self::unschedule_hook('mp_process_newsletter');
 343          self::unschedule_hook('mp_schedule_newsletters');
 344      }
 345  
 346  	public static function unschedule_hook($hook)
 347      {
 348          $crons = _get_cron_array();
 349          foreach($crons as $timestamp => $v)
 350          {
 351              unset( $crons[$timestamp][$hook] );
 352              if ( empty($crons[$timestamp]) ) unset( $crons[$timestamp] );
 353          }
 354          _set_cron_array( $crons );
 355      }
 356  
 357  // for link on plugin page
 358  	public static function plugin_action_links($links, $file)
 359      {
 360          return MailPress::plugin_links($links, $file, plugin_basename(__FILE__), 'subscriptions');
 361      }
 362  
 363  // for role & capabilities
 364  	public static function capabilities($capabilities) 
 365      {
 366          $capabilities['MailPress_manage_newsletters'] = array(    'name'  => __('Newsletters', MP_TXTDOM), 
 367                                                  'group' => 'users'
 368                                          );
 369          $capabilities['MailPress_test_newsletters'] = array(    'name'  => __('Post test', MP_TXTDOM), 
 370                                                  'group' => 'admin'
 371                                          );
 372          return $capabilities;
 373      }
 374  
 375  // for settings
 376  	public static function settings_tab($tabs)
 377      {
 378          $tabs['subscriptions'] = __('Subscriptions', MP_TXTDOM);
 379          return $tabs;
 380      }
 381  
 382  // for settings general
 383  	public static function settings_general()
 384      {
 385          global $mp_general;
 386  ?>
 387              <tr>
 388                  <th class='thtitle'><?php _e('Newsletters', MP_TXTDOM); ?></th>
 389                  <td></td>
 390              </tr>
 391              <tr class='mp_sep'>
 392                  <th><?php _e('Newsletters show at most', MP_TXTDOM); ?></th>
 393                  <td style='padding:0;'>
 394                      <select name='general[post_limits]'>
 395  <option value="0">&#160;</option>
 396  <?php MP_AdminPage::select_number(1, 99, (isset($mp_general['post_limits'])) ? $mp_general['post_limits'] : ''); ?>
 397                      </select>
 398                      &#160;<?php _e('posts <i>(blank = WordPress Reading setting)</i>', MP_TXTDOM); ?>
 399                  </td>
 400              </tr>
 401  <?php
 402      }
 403  
 404  // for settings subscriptions
 405  	public static function settings_subscriptions()
 406      {
 407          include  (MP_ABSPATH . 'mp-admin/includes/settings/subscriptions_newsletter.form.php');
 408      }
 409  
 410  // for settings logs
 411  	public static function settings_logs($logs)
 412      {
 413          MP_AdminPage::logs_sub_form(self::log_name, $logs, __('Newsletter', MP_TXTDOM));
 414      }
 415  
 416  // for meta box in user page
 417  	public static function update_meta_boxes_user() 
 418      {
 419          if (!isset($_POST['id'])) return;
 420          if (!isset($_POST['keep_newsletters'])) $_POST['keep_newsletters'] = array();
 421  
 422          self::update_checklist($_POST['id']);
 423      }
 424  
 425  	public static function add_meta_boxes_user($mp_user_id, $screen)
 426      {
 427          add_meta_box('newsletterdiv', __('Newsletters', MP_TXTDOM), array(__CLASS__, 'meta_box'), $screen, 'normal', 'core');
 428      }
 429  
 430  	public static function meta_box($mp_user)
 431      { 
 432          $check_newsletters = self::get_checklist($mp_user->id, array('admin' => true));
 433          echo ($check_newsletters) ? $check_newsletters : __('Nothing to subscribe for ...', MP_TXTDOM) . " <a href='" . MailPress_settings . "&amp;tab=subscriptions'>" . __('Settings') . '</a>';
 434      }
 435  
 436  // for meta box in write post  ////
 437  	public static function add_meta_boxes_post($page, $type, $post)
 438      {
 439          if ('post' != $page) return;
 440          if ('side' != $type) return;
 441  
 442          wp_register_script('mp-meta-box-post-test',     '/' . MP_PATH . 'mp-includes/js/meta_boxes/post/test.js', array('wp-ajax-response'), false, 1);
 443          wp_localize_script('mp-meta-box-post-test',     'mpMeta_box_postL10n', array( 
 444              'url' => MP_Action_url
 445          ) );
 446          wp_enqueue_script('mp-meta-box-post-test');
 447  
 448          wp_register_script( 'mp-thickbox',         '/' . MP_PATH . 'mp-includes/js/mp_thickbox.js', array('thickbox'), false, 1);
 449          wp_enqueue_script('mp-thickbox');
 450  
 451          add_meta_box('MailPress_post_test_div', __('MailPress test', MP_TXTDOM), array(__CLASS__, 'meta_box_post_test'), 'post', 'side', 'core');
 452      }
 453  
 454  	public static function meta_box_post_test($post) 
 455      {
 456          include  (MP_ABSPATH . 'mp-includes/meta_boxes/post/test.php');
 457      }
 458  
 459  
 460  //// Mp_users list  ////
 461  
 462  	public static function users_restrict($url_parms)
 463      {
 464          $x = (isset($url_parms['newsletter'])) ? $url_parms['newsletter'] : '';
 465          $dropdown_options = array('show_option_all' => __('View all newsletters', MP_TXTDOM), 'selected' => $x );
 466          self::dropdown($dropdown_options);
 467      }
 468  
 469  	public static function users_columns($x)
 470      {
 471          $date = array_pop($x);
 472          $x['newsletters']=  __('Newsletters', MP_TXTDOM);
 473          $x['date']        = $date;
 474          return $x;
 475      }
 476  
 477  	public static function users_get_list($array, $url_parms)
 478      {
 479          if (!isset($url_parms['newsletter']) || empty($url_parms['newsletter'])) return $array;
 480  
 481          global $mp_registered_newsletters;
 482          global $wpdb;
 483  
 484          if (!isset($mp_registered_newsletters[$url_parms['newsletter']])) return $array;
 485  
 486          list($where, $tables) = $array;
 487  
 488          $newsletter = $mp_registered_newsletters[$url_parms['newsletter']];
 489          $in     = ($newsletter['default']) ? 'NOT' : '';
 490  
 491          $where .= " AND $in EXISTS 	(
 492                      SELECT DISTINCT z.mp_user_id
 493                      FROM     $wpdb->mp_usermeta z
 494                      WHERE z.meta_key = '" . self::meta_key . "'
 495                      AND     z.meta_value = '" . $newsletter['id'] . "'
 496                      AND     z.mp_user_id = a.id
 497                  ) ";
 498  
 499          return array($where, $tables, true);
 500      }
 501  
 502  	public static function users_get_row($column_name, $mp_user, $url_parms)
 503      {
 504          if ('newsletters' != $column_name) return;
 505          $out = array();
 506  
 507          $newsletters = MP_Newsletter::get_object_terms($mp_user->id);
 508          if (!empty($newsletters))
 509          {
 510              foreach($newsletters as $k => $v)
 511              {
 512                  $out[] = "<a href='" . MailPress_users . "&amp;newsletter=$k'>$v</a>";
 513              }
 514  
 515              echo join( ', ', $out );
 516              return;
 517          }
 518          _e('None ', MP_TXTDOM);
 519      }
 520  
 521  	public static function dropdown($args = '')
 522      {
 523          $defaults = array('class'        => 'postform',
 524                      'echo'         => 1,
 525                      'htmlid'        => 'newsletter_dropdown',
 526                      'htmlname'     => 'newsletter',
 527                      'selected'     => 0
 528                      );
 529  
 530          $r = wp_parse_args( $args, $defaults );
 531          extract( $r );
 532  
 533          $x = MP_Newsletter::get_active();
 534  
 535          $output = '';
 536          if ( ! empty($x) )
 537          {
 538              if ( $show_option_all ) $list[0] = $show_option_all;
 539              foreach($x as $k => $v) $list[$k] = $v;
 540  
 541              $htmlid = ($htmlid === true) ? "id='$htmlname'" : "id='$htmlid'" ;
 542              $output = "<select name='$htmlname' $htmlid class='$class'>\n";
 543              $output .= MP_::select_option($list, $selected, false);
 544              $output .= "</select>\n";
 545          }
 546  
 547          if ( $echo )    echo $output;
 548  
 549          return $output;
 550      }
 551  
 552  // for ajax
 553  	public static function mp_action_mp_meta_box_post_test() 
 554      {
 555          global $mp_registered_newsletters;
 556  
 557          $post_id = $_POST['post_id'];
 558          if (empty($post_id))            return new WP_Error( 'post', __('post not saved', MP_TXTDOM) );
 559          $post = get_post($post_id);
 560          if (!$post)                    return new WP_Error( 'post', __('post not saved', MP_TXTDOM) );
 561  
 562          $newsletter = MP_Newsletter::get($_POST['newsletter']);
 563          if (!$newsletter)                return new WP_Error( 'newsletter', __('unknown newsletter', MP_TXTDOM) );
 564  
 565          $theme = $_POST['theme'];
 566          if (empty($theme) && isset($newsletter['mail']['Theme'])) $theme = $newsletter['mail']['Theme'];
 567  
 568          update_user_meta(MP_WP_User::get_id(), "_MailPress_post_$post_id", array('toemail' => $_POST['toemail'], 'theme' => $theme, 'newsletter' => $_POST['newsletter']));    
 569  
 570          $newsletter['mail']['Theme']         = $theme;
 571          $newsletter['mail']['subject']    = __('(Test)', MP_TXTDOM) . ' ' . $newsletter['mail']['subject'];
 572          $newsletter['mail']['the_title']     = apply_filters('the_title', $post->post_title );
 573  
 574          $newsletter['query_posts']     = array( 'p'    =>    $post_id );
 575  
 576          $mail            = new stdClass();
 577          $mail->id        = MP_Mail::get_id('send_post_ajax');
 578          $mail->toemail     = $_POST['toemail'];
 579  
 580          $rc = MP_Newsletter::send($newsletter, false, $mail);
 581  
 582          if (!$rc) MP_Mail::delete($mail->id);
 583  
 584          $x = new WP_Ajax_Response( array    (
 585                          'what' => 'mp_post_test', 
 586                          'id' => $mail->id, 
 587                          'data' => !$rc ? __('Sending mail failed !', MP_TXTDOM) : sprintf('<span id="mail-%1$s">%2$s</span>', $mail->id , sprintf(__('%1$sView%2$s sent mail', MP_TXTDOM), sprintf('<a href="%1$s" class="thickbox thickbox-preview">', esc_url(MP_::url( MP_Action_url, array('action' => 'iview', 'id' => $mail->id, 'preview_iframe' => 1, 'TB_iframe' => 'true')))), '</a>'))
 588                          )
 589          );
 590          $x->send();
 591      }
 592  }
 593  new MailPress_newsletter();
 594  }


Generated: Thu Apr 28 18:38:52 2016 Cross-referenced by PHPXref 0.7.1