PHP Class BP_Reply_By_Email_Parser, bp-reply-by-email

Since: 1.0-RC3.
Afficher le fichier Open project: r-a-y/bp-reply-by-email Class Usage Examples

Méthodes publiques

Свойство Type Description
$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.

Méthodes publiques

Méthode Description
__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.

Méthodes protégées

Méthode Description
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).

Method Details

__construct() public méthode

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() protected static méthode

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

get_body() public static méthode

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.
Résultat string | boolean

get_header() public static méthode

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.
Résultat mixed Either the email header on success or false on failure

get_parameters() protected static méthode

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

get_querystring() public static méthode

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
Résultat mixed Either the address tag on success or false on failure

init() public static méthode

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
Résultat array | object Array of the parsed item on success. WP_Error object on failure.

is_new_item() protected static méthode

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
Résultat boolean

validate_headers() public static méthode

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
Résultat mixed Array of email headers. False if no headers or if the email is junk.

Property Details

$content public_oe static_oe property

The email body content.
public static string $content
Résultat string

$headers public_oe static_oe property

Email headers of the current email.
public static array $headers
Résultat array

$is_html public_oe static_oe property

Whether the current email uses HTML exclusively.
public static bool $is_html
Résultat boolean

$querystring public_oe static_oe property

The querystring parsed from the 'From' email address.
public static string $querystring
Résultat string

$subject public_oe static_oe property

The email subject line.
public static string $subject
Résultat string

$user public_oe static_oe property

The WP_User object when successfully parsed.
public static object $user
Résultat object