PHP 클래스 WPAS_Email_Notification

This class handles all e-mail notifications. One instance of this class relates to one and one only post, but can handle multiple notifications for the same post. The available notifications can be extended with the use of a few filters available throughout the class and the dispatch of e-mails is handled by the pluggable function wp_mail(). It is recommended to use a proper SMTP server for e-mail routing in order to ensure a safe delivery.
저자: ThemeAvenue ([email protected])
파일 보기 프로젝트 열기: awesome-support/awesome-support 1 사용 예제들

공개 메소드들

메소드 설명
__construct ( integer $post_id ) Class constructor.
__destruct ( )
fetch ( string $contents ) : string Convert tags within a string.
get_cases ( ) : array Get available notification cases.
get_reply ( ) : boolean | object Ge the post object for the reply.
get_sender ( ) : array Get sender data.
get_tags ( ) : array Get the available template tags.
get_tags_values ( ) : array Get tags and their value in the current context.
get_ticket ( ) : boolean | object Ge the post object for the ticket.
is_active ( string $case ) : boolean Check if the requested notification is active.
notification_exists ( string $case ) : boolean Check if the requested notification exists.
notify ( string $case ) : boolean | object Send out the e-mail notification.
set_html_mime_type ( ) : string Set the e-mail content type to HTML.
set_text_mime_type ( ) : string Set the e-mail content type to plain text.

비공개 메소드들

메소드 설명
cases_active_option ( ) : array Get notification cases active option name.
get_body ( $case ) : string Get e-mail body.
get_content ( string $part, string $case ) : string Get e-mail content.
get_formatted_email ( string $content = '' ) : string Retrieve the e-mail template to use and input the content
get_subject ( $case ) : string Get e-mail subject.

메소드 상세

__construct() 공개 메소드

Class constructor.
public __construct ( integer $post_id )
$post_id integer ID of the post to notify about

__destruct() 공개 메소드

public __destruct ( )

fetch() 공개 메소드

Takes a string (subject or body) and replace the tags with their current value if any.
부터: 3.0.0
public fetch ( string $contents ) : string
$contents string String to convert tags from
리턴 string String with tags converted into their corresponding value

get_cases() 공개 메소드

Get available notification cases.
부터: 3.0.2
public get_cases ( ) : array
리턴 array Array of the available cases

get_reply() 공개 메소드

Ge the post object for the reply.
부터: 3.0.2
public get_reply ( ) : boolean | object
리턴 boolean | object The reply object if there is a reply, false otherwise

get_sender() 공개 메소드

Get sender data.
부터: 3.0.2
public get_sender ( ) : array
리턴 array Array containing the sender name and e-mail as well as the reply address

get_tags() 공개 정적인 메소드

This is just a list of available tags, no value is attached to those tags. This list is used both for value attribution and in the contextual help in the plugin settings page.
부터: 3.0.2
public static get_tags ( ) : array
리턴 array Array of tags with their description

get_tags_values() 공개 메소드

Get tags and their value in the current context.
부터: 3.0.0
public get_tags_values ( ) : array
리턴 array Array of tag / value pairs

get_ticket() 공개 메소드

Ge the post object for the ticket.
부터: 3.0.2
public get_ticket ( ) : boolean | object
리턴 boolean | object The ticket object if there is a reply, false otherwise

is_active() 공개 메소드

E-mail notifications can be enabled or disabled on a per-case basis by the user in the plugin settings. We need to check that the requested notification hasn't been disabled by the user before sending it out.
부터: 3.0.2
public is_active ( string $case ) : boolean
$case string The notification case requested
리턴 boolean True if the notification is enabled for this case, false otherwise

notification_exists() 공개 메소드

Check if the requested notification exists.
public notification_exists ( string $case ) : boolean
$case string The notification case requested
리턴 boolean True if such a case exists, false otherwise

notify() 공개 메소드

Send out the e-mail notification.
부터: 3.0.2
public notify ( string $case ) : boolean | object
$case string The notification case
리턴 boolean | object True if the notification was sent, WP_Error otherwise

set_html_mime_type() 공개 메소드

Set the e-mail content type to HTML.
부터: 3.1.1
public set_html_mime_type ( ) : string
리턴 string HTML content type

set_text_mime_type() 공개 메소드

Set the e-mail content type to plain text.
부터: 3.1.1
public set_text_mime_type ( ) : string
리턴 string Text content type