Beispiel #1
0
 /**
  *
  * @since 2.0.0
  *
  * @param string $format 'html' or 'text', default 'html'.
  * @return string
  */
 public function select_reply_prompt($format = Prompt_Enum_Content_Types::HTML)
 {
     if ($format == Prompt_Enum_Content_Types::TEXT) {
         return Prompt_Content_Handling::reduce_html_to_utf8($this->select_reply_prompt(Prompt_Enum_Content_Types::HTML));
     }
     $subscribe_mailto = sprintf('mailto:{{{reply_to}}}?subject=%s&body=%s', __('Just hit send', 'Postmatic'), $this->subscribe_phrase());
     return sprintf(__('To get new posts by %s as soon as they are published, reply with the phrase \'%s\'.', 'Postmatic'), $this->get_wp_user()->display_name, "<a href=\"{$subscribe_mailto}\">{$this->subscribe_phrase()}</a>");
 }
Beispiel #2
0
 /**
  *
  * @since 2.0.0
  *
  * @param string $format 'html' or 'text', default 'html'.
  * @return string
  */
 public function select_reply_prompt($format = Prompt_Enum_Content_Types::HTML)
 {
     $subscribe_mailto = sprintf('mailto:{{{reply_to}}}?subject=%s&body=%s', __('Just hit send', 'Postmatic'), $this->subscribe_phrase());
     return Prompt_Content_Handling::html_or_reduced_utf8($format, sprintf(__('To get new posts as soon as they are published, reply with the word \'%s\'.', 'Postmatic'), "<a href=\"{$subscribe_mailto}\">{$this->subscribe_phrase()}</a>"));
 }
 protected function send_notifications($recipient_ids)
 {
     $template_data = array('post' => $this->prompt_post, 'comment_header' => true);
     /**
      * Filter comment email template data.
      *
      * @param array $template_data {
      * @type Prompt_post $post
      * @type bool $comment_header
      * }
      */
     $template_data = apply_filters('prompt/comment_flood_email/template_data', $template_data);
     $html_template = new Prompt_Template('comment-flood-email.php');
     $text_template = new Prompt_Text_Template('comment-flood-email-text.php');
     $footnote_html = sprintf(__('You received this email because you\'re subscribed to %s.', 'Postmatic'), $this->prompt_post->subscription_object_label());
     $batch = new Prompt_Email_Batch(array('subject' => __('We\'re pausing comment notices for you.', 'Postmatic'), 'text_content' => $text_template->render($template_data), 'html_content' => $html_template->render($template_data), 'message_type' => Prompt_Enum_Message_Types::SUBSCRIPTION, 'reply_to' => '{{{reply_to}}}', 'footnote_html' => $footnote_html, 'footnote_text' => Prompt_Content_Handling::reduce_html_to_utf8($footnote_html)));
     foreach ($recipient_ids as $recipient_id) {
         $subscriber = get_userdata($recipient_id);
         if (!$subscriber or !$subscriber->user_email) {
             continue;
         }
         $command = new Prompt_Comment_Flood_Command();
         $command->set_post_id($this->prompt_post->id());
         $command->set_user_id($recipient_id);
         $batch->add_individual_message_values(array('to_address' => $subscriber->user_email, 'reply_to' => Prompt_Email_Batch::trackable_address(Prompt_Command_Handling::get_command_metadata($command))));
     }
     /**
      * Filter comment notification email batch.
      *
      * @param Prompt_Email_Batch $batch
      * @param array $template_data see prompt/comment_email/template_data
      */
     $batch = apply_filters('prompt/comment_flood_email_batch', $batch, $template_data);
     Prompt_Factory::make_mailer($batch)->send();
 }
Beispiel #4
0
 /**
  *
  * @since 2.0.0
  *
  * @param string $format 'html' or 'text', default 'html'.
  * @return string
  */
 public function select_reply_prompt($format = Prompt_Enum_Content_Types::HTML)
 {
     $subscribe_mailto = sprintf('mailto:{{{reply_to}}}?subject=%s&body=%s', __('Just hit send', 'Postmatic'), $this->subscribe_phrase());
     return Prompt_Content_Handling::html_or_reduced_utf8($format, sprintf(__('To get all new comments on %1%s, reply with the word \'%2$s\'</a>.', 'Postmatic'), $this->get_wp_post()->post_title, "<a href=\"{$subscribe_mailto}\">{$this->subscribe_phrase()}</a>"));
 }