gravitysmtp_attachment_uploads_dir_path

Description

The gravitysmtp_attachment_uploads_dir_path filter lets you customize the directory path where Gravity SMTP saves email attachments.

Usage

add_filter( 'gravitysmtp_attachment_uploads_dir_path', 'your_function_name', 10, 3 );

Parameters

ParameterTypeDescription
$uploads_dirstringThe current directory for uploading this file.
$email_idintThe current email ID.
$attachmentsarrayAn array of file paths representing the attachments.

Examples

Change the attachment storage location.

add_filter( 'gravitysmtp_attachment_uploads_dir_path', 'custom_attachment_path', 10, 3 );
function custom_attachment_path( $uploads_dir, $email_id, $attachments ) {
    // do something
    return $uploads_dir;
}

Source Code

This filter is located in includes/utils/class-attachments-saver.php