WP Manifestindependent plugin directory
manifest / ecommerce / wooaddattachment

WooCommerce Add Attachment

Simple plugin for adding attachments to WooCommerce order confirmed emails

by gronnmann · github.com/gronnmann/wooaddattachment · website

★ 0stars
0forks

Install

No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:

wp plugin install https://github.com/gronnmann/wooaddattachment/archive/refs/heads/master.zip

Adds Media Library files to WooCommerce completed-order emails.

Requirements

  • WordPress 6.5 or newer
  • PHP 8.1 or newer
  • WooCommerce 8.0 or newer

Installation

  1. Download the installable ZIP from the GitHub Releases page.
  2. In WordPress, open Plugins → Add New Plugin → Upload Plugin.
  3. Upload the ZIP, install it, and activate it.
  4. Open WooCommerce → Email Attachments.
  5. Choose one or more files from the Media Library and save the settings.

The selected files are attached to customer completed-order emails. Other WooCommerce and WordPress emails are unchanged.

S3-backed Media Libraries

The plugin supports Media Library files stored through Human Made S3 Uploads and other WordPress-compatible stream wrappers.

WordPress mail transports require attachment paths on the local filesystem. When a configured file has a stream path such as s3://bucket/uploads/file.pdf, the plugin copies it to a private temporary directory for the duration of the request. The original filename and extension are retained, and the temporary copy is removed at shutdown. Local attachments are passed through unchanged.

If a file cannot be read or copied, the plugin omits that attachment so the email can still be sent. The failure is recorded under WooCommerce → Status → Logs using the woo-add-attachment source.

Development

Install the development dependencies and run all checks:

composer install
composer check

Pull requests and branch pushes run the same checks in GitHub Actions. Pushing a semantic version tag such as v1.1.0 runs the checks, builds an installable ZIP, and creates the corresponding GitHub Release.

Changelog

1.1.0

  • Add support for S3 and other stream-backed email attachments.
  • Preserve original attachment filenames for API mail transports such as Zoho.
  • Prevent an unreadable attachment from blocking email delivery.
  • Harden settings validation and admin-page rendering.
  • Add automated coding-standard, compatibility, unit, and release checks.

1.0.0

  • Initial release.

License

MIT