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

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

공개 프로퍼티들

프로퍼티 타입 설명
$content string The email body content.
$headers array Email headers of the current email.
$is_html boolean Whether the current email uses HTML exclusively.
$querystring string The querystring parsed from the 'From' email address.
$subject string The email subject line.
$user object The WP_User object when successfully parsed.

공개 메소드들

메소드 설명
__construct ( array $args = [], $i = 1 ) Constructor.
get_body ( string $body = '', boolean $html = false, boolean $reply = true, integer $i = 1 ) : string | boolean Parses and returns the email body content.
get_header ( array | object $headers, string $key ) : mixed Returns an email header.
get_querystring ( string $address = '' ) : mixed Returns the querystring from an email address.
init ( $args = [], $i = 1 ) : array | object Static initializer.
validate_headers ( array $headers = [], integer $i ) : mixed Checks email headers for auto-submitted / auto-replies.

보호된 메소드들

메소드 설명
clear_properties ( ) Clears static properties after reaching the end of parsing.
get_parameters ( ) : mixed Decodes the encoded querystring from {@link BP_Reply_By_Email_Parser::get_querystring()}.
is_new_item ( ) : boolean Check to see if we're parsing a new item (like a new forum topic).

메소드 상세

__construct() 공개 메소드

Constructor.
public __construct ( array $args = [], $i = 1 )
$args array { An array of arguments. @type array $headers Email headers. @type string $to_email The 'To' email address. @type string $from_email The 'From' email address. @type string $content The email body content. @type string $subject The email subject line. @type bool $html Whether the email content is HTML or not. }

clear_properties() 보호된 정적인 메소드

This is to prevent any lingering properties when used in a loop.
protected static clear_properties ( )

get_body() 공개 정적인 메소드

Parses and returns the email body content.
public static get_body ( string $body = '', boolean $html = false, boolean $reply = true, integer $i = 1 ) : string | boolean
$body string The email body content.
$html boolean Whether the email body is HTML or not. Defaults to false.
$reply boolean Whether the current item is a reply. Defaults to true.
$i integer The current email message number.
리턴 string | boolean

get_header() 공개 정적인 메소드

If a header includes the user's name, it will return just the email address. eg. r-a-y -> [email protected]
public static get_header ( array | object $headers, string $key ) : mixed
$headers array | object Email headers
$key string The key we want to check against the array.
리턴 mixed Either the email header on success or false on failure

get_parameters() 보호된 정적인 메소드

Then, extracts the params into an array.
protected static get_parameters ( ) : mixed
리턴 mixed Either an array of params on success or false on failure

get_querystring() 공개 정적인 메소드

In IMAP mode: [email protected]> -> THEQUERYSTRING In Inbound mode: [email protected] -> THEQUERYSTRING The querystring is encoded by default.
public static get_querystring ( string $address = '' ) : mixed
$address string The email address containing the address tag
리턴 mixed Either the address tag on success or false on failure

init() 공개 정적인 메소드

Returns an array of the parsed item on success. WP_Error object on failure. For parameters, see constructor.
public static init ( $args = [], $i = 1 ) : array | object
리턴 array | object Array of the parsed item on success. WP_Error object on failure.

is_new_item() 보호된 정적인 메소드

New items will always have "-new" appended to the querystring. This is what we're checking for. eg. djlkjkdjfkd-new = true jkljd8fujkdjkdf = false
protected static is_new_item ( ) : boolean
리턴 boolean

validate_headers() 공개 정적인 메소드

Checks email headers for auto-submitted / auto-replies.
public static validate_headers ( array $headers = [], integer $i ) : mixed
$headers array The email headers to check
$i integer The current email message number
리턴 mixed Array of email headers. False if no headers or if the email is junk.

프로퍼티 상세

$content 공개적으로 정적으로 프로퍼티

The email body content.
public static string $content
리턴 string

$headers 공개적으로 정적으로 프로퍼티

Email headers of the current email.
public static array $headers
리턴 array

$is_html 공개적으로 정적으로 프로퍼티

Whether the current email uses HTML exclusively.
public static bool $is_html
리턴 boolean

$querystring 공개적으로 정적으로 프로퍼티

The querystring parsed from the 'From' email address.
public static string $querystring
리턴 string

$subject 공개적으로 정적으로 프로퍼티

The email subject line.
public static string $subject
리턴 string

$user 공개적으로 정적으로 프로퍼티

The WP_User object when successfully parsed.
public static object $user
리턴 object