Mailtrap
Learn how to send emails via Mailtrap using Comify.
The Mailtrap provider enables you to deliver professional transactional emails to your customers through the Comify Platform. With a single API integration, you can create seamless multi-channel communication experiences.
Getting Started
Implementing the Mailtrap email provider requires three primary steps: creating a Mailtrap account, generating a Mailtrap API token, and configuring the Mailtrap integration within your Comify platform.
Creating a Mailtrap Account
Follow these steps to set up your Mailtrap account:
- Visit Mailtrap’s official website and select “Sign Up”.
- Enter all required information to create your account or sign up with your Google, GitHub, or Microsoft account.
- Complete any additional verification process if prompted.
- Once verification is complete, you’ll be directed to your Mailtrap dashboard.
Creating a Sending Domain
Before generating an API token, you’ll need to set up and verify a sending domain:
- In your Mailtrap dashboard, navigate to Email Sending > Sending Domains.
- Click “Add Domain” and enter your domain name.
- Follow the instructions to add and verify the required DNS records.
- Wait for the domain verification to complete.
Creating a Mailtrap API Token
Follow these steps to access and secure your Mailtrap API token:
- In your Mailtrap dashboard, navigate to Settings in the left sidebar, then select API Tokens.
- To add a new token, click the “Add Token” button in the upper right corner.
- Enter a descriptive name for your token (e.g., “Comify Integration”) for easy identification.
- Assign appropriate permissions by checking the boxes in the corresponding access level columns. Make sure you have admin permissions on the domains you want to use.
- Click the “Save” button and your new token will appear under the API Tokens main menu.
- Alternatively, you can use the auto-created token per domain. When you create a domain, a token is automatically created and named based on the formula: [domain name] + [token] + [token ID].
- To find the token for a specific domain, go to Email Sending > Sending Domains, select your domain, click the “Integration” tab, and choose API or SMTP integration to view your token.
Creating a Comify API Key
Before configuring the Mailtrap integration, you’ll need to generate a Comify API key for authentication:
- Access your Comify account dashboard.
- Navigate to the API Keys management section at https://cloud.comify.io/settings/api-keys.
- Select “Generate API Key” if not already generated.
- Provide a clear, descriptive name for your key (e.g., “Mailtrap Integration”) to facilitate future management.
- Copy and store this API key in a secure location. You’ll use this key in your application code to authenticate requests to the Comify platform.
Configuring Mailtrap Integration in Comify
To establish the connection between Comify and Mailtrap:
- Sign in to your Comify platform dashboard.
- Navigate to Integration Store > Add Integration > E-mail.
- From the available email service providers, select Mailtrap.
- Enter the Mailtrap API token you generated earlier.
- Configure any additional provider-specific settings according to your requirements.
- Click Save to finalize the integration.
Creating Email Templates
After successfully configuring the Mailtrap integration, you can design email templates directly within the Comify platform:
- Navigate to the Manage Templates section in your Comify dashboard.
- Select the
Email
tab from the available channel options. - Click
Create Template
to begin the design process. - Choose from multiple template creation methods based on your preference and skill level:
- AI-Assisted Design: Utilize the
AI Writer
feature in the Email Editor section for automated content generation. - Manual HTML Editing: Select
Switch to HTML
in the Email Editor for direct code editing. - Import Existing Templates: Use the Chrome extension to copy HTML from existing templates for reuse in Comify.
- AI-Assisted Design: Utilize the
Sending Email Templates
Implement the following code examples in your application to trigger email template delivery:
Upon successful API request processing, you will receive a response containing a unique requestId and confirmation message:
Important: The API may return a success response even when there are underlying issues with your request. For comprehensive delivery monitoring and troubleshooting, we recommend reviewing the complete request logs in the Activity Feed dashboard.