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
Parameter | Type | Description |
---|---|---|
$uploads_dir | string | The current directory for uploading this file. |
$email_id | int | The current email ID. |
$attachments | array | An 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