Use P2 Theme Via Email: Get Notifications To All P2 Posts, Replies & Reply Back Or Create New Posts Also From Email

P2 is a popular Twitter inspired group blogging theme with hassle free front-end posting, live replies, tags and fully dynamic display with threaded comments etc. This tutorial is on new addon P2 plugin called P2 By Email, the plugin fully integrates your P2 theme with email and it makes it perfect for communicating with your team on the go.

With this plugin you can use P2 by email for:

  1. Getting instant notifications when posts or comments are published.
  2. Ensure you are always notified when your username is mentioned.
  3. Yon can reply to posts or comments by email.
  4. Create new posts with a secret email address.

Install and activate it, after activation by by default your all P2 blog users will start receiving all post and comment notifications.

But to enable post or reply via email, follow a few more steps:

  1. Register a Gmail or similar email account that supports IMAP.
  2. Add the code snippet below with account details to your theme’s functions.php file. It tells P2 By Email that you’re set up to use post or reply by email.
  3. Install wp-cli and set up a system cron job to regularly call wp p2-by-email ingest-emails.
add_filter( 'p2be_email_replies_enabled', '__return_true' );
add_filter( 'p2be_emails_reply_to_email', function( $email ) {
    return 'YOURACCOUNT@gmail.com';
});
add_filter( 'p2be_imap_connection_details', function( $details ) {

    $details['host'] = '{imap.gmail.com:993/imap/ssl/novalidate-cert}';
    $details['username'] = 'YOURACCOUNT@gmail.com';
    $details['password'] = 'PASSWORD';

    return $details;
} );

Leave a Reply

Your email address will not be published. Required fields are marked *