Actions5
- Mail Actions
- Contact Actions
Overview
This node acts as a connector to the Mailtrap service, primarily designed to interact with Mailtrap's API. It supports different authentication methods and routes execution through a centralized router function that handles various actions. This setup is useful for automating email testing workflows, such as sending test emails, managing inboxes, or retrieving email data within an n8n workflow.
Common scenarios include:
- Sending test emails during development without spamming real users.
- Fetching and analyzing emails caught by Mailtrap for QA purposes.
- Automating email-related tasks in CI/CD pipelines.
Properties
| Name | Meaning |
|---|---|
| Authentication | Method of authenticating with Mailtrap API. Options: "API Token" or "Bearer Token". |
Output
The node outputs JSON data corresponding to the results of the executed Mailtrap API actions routed via the internal router. The exact structure depends on the specific action performed (e.g., fetching emails, sending messages). If binary data is involved (such as email attachments), it would be included accordingly, but this is not explicitly shown in the provided code.
Dependencies
- Requires an API key credential for Mailtrap, either as an API token or a bearer token.
- Depends on internal modules for loading options (
loadOptions/getAccounts) and routing actions (actions/router). - No external environment variables are explicitly required beyond the API credentials.
Troubleshooting
- Authentication errors: Ensure the correct type of token is selected and valid. Invalid or expired tokens will cause failures.
- API call failures: Network issues or incorrect API usage may result in errors. Verify API endpoint availability and permissions.
- Missing or incorrect input properties: The node requires the authentication property; missing or invalid values will prevent execution.