Many WooCommerce store owners face the same problem: manually issuing vouchers takes hours, and off-the-shelf plugins often fail at the worst possible moment. If you run a spa, a hotel, or a service-based business, your goal is to make sales—not to struggle with broken code.
Why are popular voucher plugins often a form of technical debt?
Many off-the-shelf solutions available on the market offer only rigid templates that are difficult to adapt to a company’s branding. Worse still, premium versions that allow for HTML code editing are often bloated with unnecessary code. Users of such plugins frequently complain about:
- Compatibility issues: WooCommerce updates can break the block editor (Gutenberg).
- Errors in file generation: Uncertainty as to whether every purchased voucher has been correctly generated and sent.
- Poor support: Reports regarding errors in PDF generation can take a long time to resolve, and in the meantime, clients lose money.
Proprietary solution – custom plugin
Instead of relying on third-party modules - which can be unreliable or come with a cost - I implemented a custom solution for a client in the spa industry, built using the DOMpdf library. Rather than using a "heavy" plugin, I opted for lightweight, stable, and fully controlled code that performs exactly the required tasks:
- Full customization: The client can specify the amount and enter the relevant details (recipient and sender names), resulting in a ready-to-use PDF voucher.
- Lightweight performance: The solution does not impact the store's loading speed and does not conflict with content editors.
- End-to-end automation: The entire process—from the initial purchase to the delivery of an email containing the voucher as an attachment—is fully automated.
Safeguards against failures and anomalies
The biggest drawback of automation is the fear that something might go wrong—for instance, an email failing to reach a customer due to a temporary payment error or issues with the mail server.
In my solution, I have implemented a fail-safe mechanism:
- Any voucher that fails to be delivered due to technical reasons is automatically flagged and moved to a secure, isolated folder.
- The store owner has access to this list and can resend an unsent voucher with a single click.
Thanks to this, handling exceptions takes seconds, rather than hours spent searching for the root causes in server logs.


