PHP 클래스 BP_Reply_By_Email, bp-reply-by-email

파일 보기 프로젝트 열기: r-a-y/bp-reply-by-email 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$inbound_provider Inbound provider loader. Defaults to boolean false.

공개 메소드들

메소드 설명
activity_listener ( object $item ) Saves pertinent activity variables to our "listener" object, which is used in {@link BP_Reply_By_Email::wp_mail_filter()} Since the activity component is used in other BP components, we can also do checks for forums and blogs as well.
admin_notice ( ) Add an admin notice nag
bbp_listener ( integer $reply_id, integer $topic_id ) bbPress 2 plugin compatibility.
disable_non_rbe_notice ( boolean $retval, array $args ) : boolean For non-RBE emails, we now add a line above each message denoting that the email is not one you can reply to.
get_inbound_providers ( ) : array Get inbound providers.
get_temporary_variables ( array $retval ) : array When posting group forum topics or posts via IMAP, we need to grab some temporary variables to pass to other methods - {@link BP_Reply_By_Email::group_forum_listener()} and {@link BP_Reply_By_Email::set_group_id()}.
group_forum_listener ( integer $post_id ) BP Group Email Subscription (GES) plugin compatibility.
init ( ) Initializes the class when called upon.
load_inbound_provider ( ) Load inbound provider.
localization ( ) Custom textdomain loader.
message_listener ( object $item ) Saves pertinent message variables to our "listener" object, which is used in {@link BP_Reply_By_Email::wp_mail_filter()}
move_nonrbe_notice_in_bp_html ( string $retval, string $property_name, string $transform ) Moves the non-RBE notice in the BP HTML email content to the top of the email.
move_rbe_marker ( str $html ) : str WP Better Emails Support.
move_rbe_marker_in_bp_html ( string $retval, string $property_name, string $transform ) Moves the RBE marker in the BP HTML email content to the top of the email.
phpmailer_set_reply_to_header ( PHPMailer $phpmailer ) Set 'Reply-To' email address for PHPMailer if mailbox is > 64 characters.
post ( boolean $retval, array $data, array $params ) : array | object Post by email routine.
set_bp_email_headers ( boolean | WP_Error $retval, BP_Email $email ) Set various email headers for BP 2.5 emails.
set_bp_post_object ( WP_Post $post ) : WP_Post Modify BP email content to prepend our RBE marker.
set_group_id ( integer $retval ) : integer Overrides the current group ID with our locally-cached one from {@link BP_Reply_By_Email::get_temporary_variables()} if available.
wp_mail_filter ( array $args ) : array Adds "Reply-To" to email headers in {@link wp_mail()}.

보호된 메소드들

메소드 설명
get_reply_to_address ( array $headers = [] ) Get the email address used for the 'Reply-To' email header.
prepend_nonrbe_notice_to_content ( string $content = '', $args = [] ) : string Prepend our non-RBE notice to a string.
prepend_rbe_marker_to_content ( string $content = '' ) : string Prepend our RBE marker to a string.

비공개 메소드들

메소드 설명
constants ( ) Setup our constants.
hooks ( ) Setup RBE's hooks.
includes ( ) Include required files.

메소드 상세

activity_listener() 공개 메소드

Saves pertinent activity variables to our "listener" object, which is used in {@link BP_Reply_By_Email::wp_mail_filter()} Since the activity component is used in other BP components, we can also do checks for forums and blogs as well.
부터: 1.0-beta
public activity_listener ( object $item )
$item object The activity object created during {@link BP_Activity_Activity::save()}

admin_notice() 공개 메소드

Add an admin notice nag
부터: 1.0-beta
public admin_notice ( )

bbp_listener() 공개 메소드

bbPress has built-in email subscriptions, so let's not reinvent the wheel! Here, we hook into the 'bbp_pre_notify_subscriptions' hook so we can setup our listener. This listener is only for bbPress forums that are not attached to BuddyPress groups. For BuddyPress groups, see the BBP_RBE_Extension::extend_activity_listener() method instead.
public bbp_listener ( integer $reply_id, integer $topic_id )
$reply_id integer The forum reply ID created by bbPress
$topic_id integer The forum topic ID created by bbPress

disable_non_rbe_notice() 공개 메소드

However, there are instances where we do not want to add this line. This method disables this line when: - An email is sent from the admin area - An activation email is sent
부터: 1.0-RC2
public disable_non_rbe_notice ( boolean $retval, array $args ) : boolean
$retval boolean Should we disable the non-RBE notice?
$args array Email args passed by the 'wp_mail' filter
리턴 boolean

get_inbound_providers() 공개 정적인 메소드

Get inbound providers.
부터: 1.0-RC3
public static get_inbound_providers ( ) : array
리턴 array Key/value pairs (inbound provider name => class name)

get_reply_to_address() 보호된 메소드

Get the email address used for the 'Reply-To' email header.
부터: 1.0-RC4
protected get_reply_to_address ( array $headers = [] )
$headers array Email headers.

get_temporary_variables() 공개 메소드

When posting group forum topics or posts via IMAP, we need to grab some temporary variables to pass to other methods - {@link BP_Reply_By_Email::group_forum_listener()} and {@link BP_Reply_By_Email::set_group_id()}.
부터: 1.0-beta
public get_temporary_variables ( array $retval ) : array
$retval array Array of arguments
리턴 array Array of arguments

group_forum_listener() 공개 메소드

GES hooks into the 'bb_new_post' action to send emails in groups, so let's not reinvent the wheel. Here, we test to see if a forum topic / post is being made and we'll let GES handle the rest!
부터: 1.0-beta
public group_forum_listener ( integer $post_id )
$post_id integer The forum post ID created by bbPress

init() 공개 메소드

Initializes the class when called upon.
public init ( )

load_inbound_provider() 공개 메소드

Load inbound provider.
부터: 1.0-RC3

localization() 공개 메소드

Checks WP_LANG_DIR for the .mo file first, then the plugin's language folder. Allows for a custom language file other than those packaged with the plugin.
부터: 1.0-beta
public localization ( )

message_listener() 공개 메소드

Saves pertinent message variables to our "listener" object, which is used in {@link BP_Reply_By_Email::wp_mail_filter()}
부터: 1.0-beta
public message_listener ( object $item )
$item object The message object created during {@link BP_Messages_Message::send()}

move_nonrbe_notice_in_bp_html() 공개 메소드

For BuddyPress 2.5+.
부터: 1.0-RC5.
public move_nonrbe_notice_in_bp_html ( string $retval, string $property_name, string $transform )
$retval string Current email HTML content.
$property_name string The email property being fetched.
$transform string Transformation return type.

move_rbe_marker() 공개 메소드

WP Better Emails gives admins the ability to wrap the plain-text content around a HTML template. This interferes with the positioning of RBE's marker and how RBE parses the reply. So what we do in this method is to reposition the RBE marker to the beginning of the HTML body. This allows RBE to parse replies the way it was intended.
public move_rbe_marker ( str $html ) : str
$html str The full HTML email content from WPBE
리턴 str Modified HTML content

move_rbe_marker_in_bp_html() 공개 메소드

For BuddyPress 2.5+.
부터: 1.0-RC4.
public move_rbe_marker_in_bp_html ( string $retval, string $property_name, string $transform )
$retval string Current email HTML content.
$property_name string The email property being fetched.
$transform string Transformation return type.

phpmailer_set_reply_to_header() 공개 메소드

Have to workaround a PHPMailer mailbox character limit issue by setting the 'Reply-To' email address again after PHPMailer has done its checks. This is done for installs still using wp_mail().
public phpmailer_set_reply_to_header ( PHPMailer $phpmailer )
$phpmailer PHPMailer

post() 공개 메소드

Validates the parsed data and posts the various BuddyPress content.
부터: 1.0-RC3
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()}.
리턴 array | object Array of the parsed item on success. WP_Error object on failure.

prepend_nonrbe_notice_to_content() 보호된 메소드

Prepend our non-RBE notice to a string.
부터: 1.0-RC5
protected prepend_nonrbe_notice_to_content ( string $content = '', $args = [] ) : string
$content string
리턴 string

prepend_rbe_marker_to_content() 보호된 메소드

This adds the '--- Reply ABOVE THIS LINE to add a comment ---' line to the beginning of an email's content. Inspired by Basecamp!
부터: 1.0-RC4
protected prepend_rbe_marker_to_content ( string $content = '' ) : string
$content string
리턴 string

set_bp_email_headers() 공개 메소드

This includes the 'Reply-To' and custom 'From' headers.
부터: 1.0-RC4
public set_bp_email_headers ( boolean | WP_Error $retval, BP_Email $email )
$retval boolean | WP_Error Returns true if validation is successful, else a descriptive WP_Error.
$email BP_Email Current instance of the email type class.

set_bp_post_object() 공개 메소드

For BuddyPress 2.5+.
부터: 1.0-RC4
public set_bp_post_object ( WP_Post $post ) : WP_Post
$post WP_Post BP Email post object.
리턴 WP_Post

set_group_id() 공개 메소드

Overrides the current group ID with our locally-cached one from {@link BP_Reply_By_Email::get_temporary_variables()} if available.
부터: 1.0-beta
public set_group_id ( integer $retval ) : integer
$retval integer The group ID
리턴 integer $retval The group ID

wp_mail_filter() 공개 메소드

Also manipulates message content for Basecamp-like behaviour.
부터: 1.0-beta
public wp_mail_filter ( array $args ) : array
$args array Arguments provided via {@link wp_mail()} filter.
리턴 array

프로퍼티 상세

$inbound_provider 공개적으로 프로퍼티

Inbound provider loader. Defaults to boolean false.
public $inbound_provider