Skip to content

feat: mailtrap driver#98

Merged
productdevbook merged 11 commits into
productdevbook:mainfrom
narekhovhannisyan:feat/mailtrap-driver
Jun 19, 2026
Merged

feat: mailtrap driver#98
productdevbook merged 11 commits into
productdevbook:mainfrom
narekhovhannisyan:feat/mailtrap-driver

Conversation

@narekhovhannisyan

@narekhovhannisyan narekhovhannisyan commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds unemail/driver/mailtrap — one driver for Mailtrap Email API and Email Sandbox, same API token, switched via msg.sandbox + inboxId.

  • Production: send.api.mailtrap.io (/api/send, /api/batch)
  • Sandbox: sandbox.api.mailtrap.io (/api/send/{inboxId}, /api/batch/{inboxId})
  • Maps templates, attachments, headers, reply-to, category/tags
  • Mocked tests for routing, validation, and batch edge cases
  • Docs: docs/drivers.md subsection + README snippet

Closes #96

Add unemail/driver/mailtrap for Mailtrap transactional send and batch
APIs. Includes tests, package exports, and drivers.md matrix row.
Include a new section in the README detailing how to use the Mailtrap driver for sending emails, with a code snippet demonstrating the setup and usage in both production and sandbox environments.
Include detailed information on the Mailtrap driver, covering its usage in both production and sandbox environments. Added code examples demonstrating how to configure and send emails using the Mailtrap API.
Add options for sandbox mode in Mailtrap driver, including `sandbox`, `inboxId`, and `sandboxEndpoint`. Implement logic to handle sandbox-specific API calls and validate inbox ID requirements for sandbox usage. Update documentation comments for clarity on new options.
…ionality

Introduce multiple test cases for the Mailtrap driver to validate sandbox mode behavior, including routing, default settings, error handling for missing inbox IDs, and batch sending. Ensure that the implementation adheres to expected API interactions and error responses.
Implement a new test case to verify that the Mailtrap driver correctly switches the API host in sandbox mode without altering the payload flag. This ensures proper handling of API interactions and maintains expected behavior for metadata inclusion.
…usage

Revise README.md and drivers.md to reflect the updated terminology for Mailtrap, changing references from "production" to "Email API" and enhancing clarity on routing distinctions between Email API and sandbox environments.
… types

Refine the test description and error message assertions in the sendBatch test to specify "Email Sandbox" and "Email API" instead of generic terms, enhancing clarity on the expected behavior when handling mixed message types.
@productdevbook productdevbook changed the title Feat/mailtrap driver feat: mailtrap driver Jun 15, 2026
@productdevbook

Copy link
Copy Markdown
Owner

Thank you, it looks great.

@productdevbook
productdevbook merged commit d399e19 into productdevbook:main Jun 19, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(driver): add Mailtrap Email API (transactional)

2 participants