Before sending your email templates to production, it's important to test them in a safe environment. Mailtrap Email Sandbox allows you to test your templates, preview how they render, and verify that all variables are working correctly.
Debugging steps
1
Navigate to Templates in the menu on the left.
Navigate to Templates
2
Click the template you want to call using the API.
Select template to debug
3
Open the Integration tab.
Open Integration tab
4
Toggle the switch to Email Testing.
Toggle to Email Testing
5
And click Integrate.
Click Integrate for Testing Inbox
6
Select the desired sandbox from the dropdown menu to reveal its credentials. Copy the Host, API Token, Template UUID, and Sandbox ID.
Alternatively, you can also use one of the pre-made Code Samples.
Sandbox credentials and code samples
7
Paste the code into your project and customize it if needed. Then, run the code to send an email to the selected Email Testing sandbox.
8
Finally, check the sandbox you specified in the script.
Test email received in sandbox
The Tech Info tab contains the link to the template you tested and lists all the variables used in the template.
Tech Info tab with template details
For more details, open the API docs and go to Sandbox API → Test Emails → Send email (including templates). Under Body, click the dropdown menu, and choose EmailFromTemplate.