Troubleshooting
Attachments Are Not Being Sent
Section titled “Attachments Are Not Being Sent”File Does Not Exist
Section titled “File Does Not Exist”Check that the file exists in the media library:
- Go to Media
- Find the attachment
- Verify that the file is available
Wrong Email
Section titled “Wrong Email”Verify that you have selected the correct email:
- In the attachment settings, check the Attach to emails field
- Make sure the email that is being sent is selected
Country Restriction
Section titled “Country Restriction”If you have Enabled countries set:
- Check if the order country matches the list
- Leave the field empty for all countries
Email Is Blocked
Section titled “Email Is Blocked”Attachments Too Large
Section titled “Attachments Too Large”Some email providers block emails with large attachments:
- Gmail: max 25 MB
- Outlook: max 20 MB
- Most hosting providers: max 10-25 MB
Solution:
- Reduce file sizes
- Use a download link instead of an attachment
Blocked File Types
Section titled “Blocked File Types”Some file types are blocked:
.exe,.bat,.cmd- Password-protected archives
Recommended formats:
- PDF documents
- Images (JPG, PNG)
Product Attachment Is Not Attached
Section titled “Product Attachment Is Not Attached”Attachment Is Not Set for the Product
Section titled “Attachment Is Not Set for the Product”- Open the product detail
- Select the Attachments tab
- Set up the attachments
- Save the product
Email Is Not Selected
Section titled “Email Is Not Selected”In the product attachment settings, check the Attach to emails field.
Custom Fields Are Not Working
Section titled “Custom Fields Are Not Working”Path Does Not Exist
Section titled “Path Does Not Exist”The module checks for file existence:
if ( file_exists( $field['custom_field'] ) ) { $attachments[] = $field['custom_field'];}Check:
- That the order meta contains the correct path
- That the file exists at the path
- That the path is absolute
Meta Key Is Wrong
Section titled “Meta Key Is Wrong”Make sure you are entering the correct meta key (including the underscore at the beginning, if used).
Diagnostics
Section titled “Diagnostics”Checking Attachments in Email
Section titled “Checking Attachments in Email”add_filter( 'woocommerce_email_attachments', function( $attachments, $email_id, $order ) { error_log( sprintf( 'Email: %s, Attachments: %s', $email_id, print_r( $attachments, true ) ) );
return $attachments;}, 999, 3 );Checking Module Settings
Section titled “Checking Module Settings”$module = wpify_woo_container()->get( \WpifyWoo\Modules\EmailAttachments\EmailAttachmentsModule::class);
$settings = $module->get_setting( 'email_attachments' );print_r( $settings );Checking Product Attachments
Section titled “Checking Product Attachments”$attachments = get_post_meta( $product_id, 'email_attachments', true );print_r( $attachments );Performance
Section titled “Performance”Too Many Attachments
Section titled “Too Many Attachments”Each attachment increases email size and sending time:
- Limit the number of attachments per email
- Consider using links instead of attachments
- Use the Asynchronous Emails module to improve performance
Large Files
Section titled “Large Files”For large files:
- Compress PDF documents
- Optimize images
- Consider splitting into multiple emails
Emails Are Not Being Delivered
Section titled “Emails Are Not Being Delivered”Check Spam Folder
Section titled “Check Spam Folder”Emails with attachments have a higher probability of being marked as spam:
- Check the spam folder
- Use an SMTP plugin for better deliverability
- Set up SPF and DKIM records