Webhooks
Webhooks allow you to subscribe to real-time notifications about various events that occur in MailerSend.
Listen for events on your MailerSend account so your integration can automatically trigger reactions. You can create a webhook directly from your account.
For example, an HTTP POST callback is sent to your provided URL with a payload about the sent email. It allows you to get the most recent updates without constantly polling the API.
Webhooks 2.0 have launched! This makes webhook payloads lighter for better, faster performance. Learn more about the new webhooks.
Add a webhook to your domain
To create a webhook, follow these steps:
1. Go to the Domains page.
2. Click Manage for the domain you wish to add webhooks to.
3. Scroll down to Webhooks.
4. Click Add webhook.
5. Complete the form by entering the endpoint URL you wish the information to be sent to and your webhook name.
6. Select the events you would like to listen to, or click on receive all events if you wish to listen to them all: Delivery, Soft bounce, Hard bounce, Open, Click, Unsubscribe, Spam complaint.
For any webhooks you create, 2.0 (Recommended) will be selected by default as the webhook version. You can opt to use 1.0 (Legacy) if you prefer.
7. Click on Save webhook and you’re done!
Once you have saved your webhook, you can copy your secret webhook key to your receiving app. You can find this on the webhook management page.
You can also pause the webhook by clicking on Edit and then on the Status toggle, moving it from Enabled to Disabled.
How to test a webhook
To test your webhook:
1. Choose the webhook you wish to test and click Manage.
2. Under Events, click Test webhook.
3. Select a test event from the dropdown menu to send to the webhook’s endpoint to test your integration.
About webhook attempts
You can consult all webhook attempts that have been made in the last 7 days in the Webhook attempts section of your webhook description page.
When your webhook receives a response other than a 2xx code from your endpoint URL, or if the endpoint doesn’t respond within 3 seconds, it will show up as a failed attempt in the log section of your webhook. If it receives a 2xx, then it will show as a success.
If a webhook call fails, MailerSend will retry the call a couple of times, waiting 10 seconds between the first and second attempt and 100 seconds between the second and the third attempt to avoid hammering the application you want the information sent to.
Need more info?
Please feel free to contact us at support@mailersend.com and a member of our support team will gladly assist you.
- Getting started
-
Email
- How to test email sending in MailerSend
- Verify and authenticate a sending domain
- How to merge multiple SPF records
- Start sending transactional emails
- SMTP relay
- Activity
- Analytics
- Schedule bulk emails
- Custom headers
- How to add a custom unsubscribe header
- Sending domains
- Domain tracking options
- Inbound routing
- How to use personalization in emails
- Sender identities
- Split Testing
- How to add a survey to your emails
- Email tagging
- Templates
- How to enable Google Email Actions & Highlights
- How transactional emails work
- The difference between transactional emails and marketing emails
- SMS
- Developer tools
- Deliverability
-
Account, billing & add-ons
- Plans, features and limits
- Plan add-ons
- User management
- Change password
- Two-factor authentication
- Switch accounts
- How to whitelist IPs
- How to add a domain space to your account
- How to request a dedicated IP
- Account reputation statuses
- How to set a billing limit on your account
- How to change your payment method
- How to change or cancel your plan
- Delete account
- About MailerSend's refund and account policies
- VAT Collection for EU Customers
- VAT Collection for UK Customers
- GST Collection for Customers in India
- GST Collection for Customers in Canada
- VAT (IVA) Collection for Customers in Chile
- How to use the MailerSend iOS app
- File manager
- Integrations
- Agency guides