PHP Class Global_SMTP_Mailer

Afficher le fichier Open project: rohmann/global-smtp Class Usage Examples

Protected Properties

Свойство Type Description
$instance Singleton

Méthodes publiques

Méthode Description
__construct ( ) Checks settings, and hooks into phpmailer if everything is good.
check_headers ( array $atts ) : array Filter for wp_mail used for introspection
get_from ( $from ) : string Callback for wp_mail_from filter.
get_from_name ( $from_name ) : string Callback for wp_mail_from_name filter Applies the from name constant if a "From" header was not present.
instance ( ) : object Get this plugin's main class instance
launch ( ) Self Instantiate Note: Plugin can be disable internally by setting GLOBAL_SMTP_DISABLE to true.
mailer ( $phpmailer ) Hook PHP Mailer to use our SMTP settings
register_admin_menu ( ) : none Register our admin menu in the correct context.
render_admin_page ( ) : none Display the admin page

Méthodes protégées

Méthode Description
prepare_settings ( ) Prepare PHP Mailer settings. Allows for minimum configuration by asumming common defualts.
validate ( ) : boolean | WP_Error Validate Configuration to ensure things are setup correctly

Method Details

__construct() public méthode

Checks settings, and hooks into phpmailer if everything is good.
public __construct ( )

check_headers() public méthode

Filter for wp_mail used for introspection
public check_headers ( array $atts ) : array
$atts array Arguments passed into wp_mail
Résultat array Unmodified $atts

get_from() public méthode

Applies the from address constant if a "From" header was not present.
public get_from ( $from ) : string
Résultat string from email address

get_from_name() public méthode

Callback for wp_mail_from_name filter Applies the from name constant if a "From" header was not present.
public get_from_name ( $from_name ) : string
Résultat string from email address

instance() public static méthode

Get this plugin's main class instance
public static instance ( ) : object
Résultat object

launch() public static méthode

This is useful if you have different needs between staging and production environments.
public static launch ( )

mailer() public méthode

Hook PHP Mailer to use our SMTP settings
public mailer ( $phpmailer )

prepare_settings() protected méthode

Prepare PHP Mailer settings. Allows for minimum configuration by asumming common defualts.
protected prepare_settings ( )

register_admin_menu() public méthode

Register our admin menu in the correct context.
public register_admin_menu ( ) : none
Résultat none

render_admin_page() public méthode

Display the admin page
public render_admin_page ( ) : none
Résultat none

validate() protected méthode

Validate Configuration to ensure things are setup correctly
protected validate ( ) : boolean | WP_Error
Résultat boolean | WP_Error Returns true if successful, else WP_Error with message

Property Details

$instance protected_oe static_oe property

Singleton
protected static $instance