Skip to content

Troubleshooting

Check that the file exists in the media library:

  1. Go to Media
  2. Find the attachment
  3. Verify that the file is available

Verify that you have selected the correct email:

  1. In the attachment settings, check the Attach to emails field
  2. Make sure the email that is being sent is selected

If you have Enabled countries set:

  1. Check if the order country matches the list
  2. Leave the field empty for all countries

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

Some file types are blocked:

  • .exe, .bat, .cmd
  • Password-protected archives

Recommended formats:

  • PDF documents
  • Images (JPG, PNG)
  1. Open the product detail
  2. Select the Attachments tab
  3. Set up the attachments
  4. Save the product

In the product attachment settings, check the Attach to emails field.

The module checks for file existence:

if ( file_exists( $field['custom_field'] ) ) {
$attachments[] = $field['custom_field'];
}

Check:

  1. That the order meta contains the correct path
  2. That the file exists at the path
  3. That the path is absolute

Make sure you are entering the correct meta key (including the underscore at the beginning, if used).

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 );
$module = wpify_woo_container()->get(
\WpifyWoo\Modules\EmailAttachments\EmailAttachmentsModule::class
);
$settings = $module->get_setting( 'email_attachments' );
print_r( $settings );
$attachments = get_post_meta( $product_id, 'email_attachments', true );
print_r( $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

For large files:

  1. Compress PDF documents
  2. Optimize images
  3. Consider splitting into multiple emails

Emails with attachments have a higher probability of being marked as spam:

  1. Check the spam folder
  2. Use an SMTP plugin for better deliverability
  3. Set up SPF and DKIM records