PHP Class BP_Docs_Comment_RBE_Extension, bp-reply-by-email

Allows group members to reply to BP Doc comments via email. Extends the abstract {@link BP_Reply_By_Email_Extension} class, which helps do a lot of the dirty work!
Since: 1.0-RC1
Inheritance: extends BP_Reply_By_Email_Extension
Mostrar archivo Open project: r-a-y/bp-reply-by-email

Public Methods

Method Description
__construct ( ) Constructor.
block_user_docs ( boolean $retval, obj $item ) : boolean Limit BP Docs comment functionality to groups only.
comment_activity_action ( string $action ) : string Override BP Doc's comment activity action to add a 'via email' string.
disable_querystring ( string $querystring, obj $listener, array $args ) : string Check the BP Doc's comment settings to see if we should disable RBE's email manipulation for the current email before sending.
failure_message_to_sender ( mixed $message, string $type, array $data, integer $i, $imap ) : string | boolean Setup our extension's failure message to send back to the sender.
get_admin_mod_user_emails ( integer $group_id ) : array Return an array of a group's admin and moderator's email addresses.
internal_rbe_log ( mixed $log, string $type, array $data, integer $i, resource $connection ) : string | boolean Log our extension's error messages during the post() method.
post ( boolean $retval, array $data, array $params ) : array | object Post by email handler.

Method Details

__construct() public method

Constructor.
public __construct ( )

block_user_docs() public method

We're limiting to groups at the moment, since the Group Email Subscription plugin does all the hard work of sending emails to all group members, etc. and that this extension is explicitly built for groups. Just being extra cautious at the moment since BP Docs v1.2 at the time of this blurb hasn't completed the users module yet.
public block_user_docs ( boolean $retval, obj $item ) : boolean
$retval boolean Defaults to true. Return false to block the current email from RBE manipulation.
$item obj The activity object generated after the activity is saved.
return boolean

comment_activity_action() public method

Thanks Boone for the filter! :) Note: This isn't a required method for RBE extensions!
public comment_activity_action ( string $action ) : string
$action string The activity action
return string

disable_querystring() public method

Check the BP Doc's comment settings to see if we should disable RBE's email manipulation for the current email before sending.
public disable_querystring ( string $querystring, obj $listener, array $args ) : string
$querystring string Custom querystring that gets used for RBE's "Reply-To" email address
$listener obj RBE's listener object that was registered in the bootstrap() method.
$args array Email args from the 'wp_mail' filter
return string

failure_message_to_sender() public method

Setup our extension's failure message to send back to the sender.
public failure_message_to_sender ( mixed $message, string $type, array $data, integer $i, $imap ) : string | boolean
$message mixed
$type string Type of error message
$data array { An array of arguments. @type array $headers Email headers. @type string $content The email body content. @type string $subject The email subject line. @type int $user_id The user ID who sent the email. @type bool $is_html Whether the email content is HTML or not. @type int $i The email message number. }
$i integer The message number from the inbox loop
return string | boolean Could be a string or boolean false.

get_admin_mod_user_emails() public method

Note: The user email addresses are set as the key, not the value. This is so you can use isset($key) for a faster alternative to in_array().
public get_admin_mod_user_emails ( integer $group_id ) : array
$group_id integer The group ID
return array

internal_rbe_log() public method

Log our extension's error messages during the post() method.
public internal_rbe_log ( mixed $log, string $type, array $data, integer $i, resource $connection ) : string | boolean
$log mixed
$type string Type of error message
$data array { An array of arguments. @type array $headers Email headers. @type string $content The email body content. @type string $subject The email subject line. @type int $user_id The user ID who sent the email. @type bool $is_html Whether the email content is HTML or not. @type int $i The email message number. }
$i integer The message number from the inbox loop
$connection resource The current IMAP connection. Chances are you probably don't have to do anything with this!
return string | boolean Could be a string or boolean false.

post() public method

Validate data and post on success.
public post ( boolean $retval, array $data, array $params ) : array | object
$retval boolean True by default.
$data array { An array of arguments. @type array $headers Email headers. @type string $content The email body content. @type string $subject The email subject line. @type int $user_id The user ID who sent the email. @type bool $is_html Whether the email content is HTML or not. @type int $i The email message number. }
$params array Parsed paramaters from the email address querystring. See {@link BP_Reply_By_Email_Parser::get_parameters()}.
return array | object Array of the parsed item on success. WP_Error object on failure.