Support » Plugin: Subscribe2 » Send «only» private post notifications

Viewing 3 replies - 1 through 3 (of 3 total)
  • @deugarte,

    You could probably make use of these hooks:
    s2_send_plain_excerpt_subscribers
    s2_send_plain_fullcontent_subscribers
    s2_send_html_excerpt_subscribers
    s2_send_html_fullcontent_subscribers

    They are documented here. Each hook is passed an array of subscribers and a post ID. You could call get_post_status( $ID ) to check if it’s ‘private’ and if it isn’t return an empty array instead of the subscribers to ensure notifications don’t get sent.

    Thanks! Checking the link you recommended I found s2member_filter(), I will try with it and report later here!

    Finally I took the easy way, in subscribe2/classes/class-s2-core.php I added an OR to the mail function. Now it only sends the messages if post is private.

    function mail($recipients = array(), $subject = '', $message = '', $type = 'text', $attachments = array()) {
    		if ( ( empty($recipients) || '' == $message ) OR ($post->post_status != 'private')){ return; }
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Send «only» private post notifications’ is closed to new replies.