gravitysmtp_before_email_send

Description

The gravitysmtp_before_email_send action hook allows you to perform custom code before an email is sent through Gravity SMTP.

Usage

add_action( 'gravitysmtp_before_email_send', 'your_function_name', 10, 1 );

Parameters

ParameterTypeDescription
$email_dataarrayThe email data being sent (to, subject, message, headers, attachments).

Examples

Log email details before sending.

add_action( 'gravitysmtp_before_email_send', function( $email_data ) {
    // Do something before the email is sent by Gravity SMTP
} );

Placement

This code can be used in the functions.php file of the active theme, a custom functions plugin, a custom add-on, or with a code snippets plugin.

See also the PHP section in this article: Where Do I Put This Code?

Source Code

This action is located in gravitysmtp/includes/functions_include.php