PHP Class Falcon_Message, Falcon

ファイルを表示 Open project: rmccue/Falcon Class Usage Examples

Protected Properties

Property Type Description
$author string Author name
$html string HTML content
$options array Handler options
$reply_address_handler callable Reply-To email address handler
$subject string Subject line
$text string Text content

Public Methods

Method Description
get_author ( ) : string Get the author name
get_html ( ) : string Get the HTML content of the email
get_options ( ) : array Get the options for this message
get_reply_address ( WP_User $user ) : string | null Get the reply address
get_subject ( ) : string Get the subject line
get_text ( ) : string Get the text content of the email
set_author ( string $author ) Set the author name
set_html ( string $html ) Set the HTML content of the email
set_options ( array $options ) Set the options for this message
set_reply_address_handler ( callable $handler ) : string Set the reply address handler
set_subject ( string $subject ) Set the subject line
set_text ( stirng $text ) Set the text content of the email

Method Details

get_author() public method

Get the author name
public get_author ( ) : string
return string Author name

get_html() public method

Get the HTML content of the email
public get_html ( ) : string
return string HTML content

get_options() public method

Get the options for this message
public get_options ( ) : array
return array

get_reply_address() public method

This controls the "Reply-To" field in the email. Typically, this will contain hash data for the connector to work out what incoming emails are replying to, but this cannot be assumed.
public get_reply_address ( WP_User $user ) : string | null
$user WP_User
return string | null Reply email address

get_subject() public method

Get the subject line
public get_subject ( ) : string
return string Subject line (including prefixes)

get_text() public method

Get the text content of the email
public get_text ( ) : string
return string Plain text content

set_author() public method

This controls the "From" field in the email. The email address will be set automatically by the handler based on the preference in the admin.
public set_author ( string $author )
$author string Author name

set_html() public method

Set the HTML content of the email
public set_html ( string $html )
$html string HTML content

set_options() public method

Set the options for this message
public set_options ( array $options )
$options array { @param int $id Post ID to use for hash @param string $author Author name (leave blank for no name) }

set_reply_address_handler() public method

This controls the "Reply-To" field in the email. The callback should conform to the following interface: ** * Get reply address * * @param WP_User $user User to generate address for * @param Falcon_Message $message Message being sent * @return string Reply email address * / function my_handler( WP_User $user, Falcon_Message $message );
public set_reply_address_handler ( callable $handler ) : string
$handler callable Handler function (passed WP_User instance and Falcon_Message handler)
return string

set_subject() public method

If the subject line needs to be prefixed with the site name or similar, this should be passed in here. The text will be sent as-is to the handler.
public set_subject ( string $subject )
$subject string Subject line

set_text() public method

This should include any footer to be sent.
public set_text ( stirng $text )
$text stirng Text content

Property Details

$author protected_oe property

Author name
protected string $author
return string

$html protected_oe property

HTML content
protected string $html
return string

$options protected_oe property

Handler options
protected array $options
return array

$reply_address_handler protected_oe property

Reply-To email address handler
protected callable $reply_address_handler
return callable

$subject protected_oe property

Subject line
protected string $subject
return string

$text protected_oe property

Text content
protected string $text
return string