PHP Класс BP_Reply_By_Email_Parser, bp-reply-by-email

С версии: 1.0-RC3.
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$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