- What's new
Continuing Our Commitment: HTTPS Innovation And Optimization
Last week we released a much-requested email tracking feature: domain-level webhooks. Continuing on that theme, this week we’ve released another webhook-related feature: easy testing for Routes webhooks. Now you can test your Routes webhook endpoints by POSTing a sample message to your app directly from your Mailgun control panel. We’ll be rolling out a similar Test feature for Tracking webhooks in the coming weeks so stay tuned for that.
We’d tried to make testing your Routes webhooks as simple as possible. All you need to do is enter a URL where you want to receive an HTTP POST and we’ll POST a sample message with values for all available parameters. This way you can test your webhook handler and make sure everything is working properly prior to sending real email traffic. As always, you can also test how your Routes match against certain Filter Expressions you’ve created.
We’ve posted this code before, and we’ll post it again here because its helpful. If you’re using webhooks to parse incoming messages, you need a way to process the incoming data. Here is a little Flask app that you can use to get started and customize for your specific use case.
from flask import Flask
from flask import request
app = Flask(__name__)
@app.route('/mailgun-tracking', methods=['GET', 'POST'])
def tracking():
# access some of the email parsed values:
request.form['recipient']
request.form['from']
request.form['subject']
# extended parameters
request.form['Message-Id']
request.form['message-headers']
request.form['timestamp']
request.form['body-plain']
request.form['stripped-html']
request.form['stripped-text']
request.form['stripped-signature']
return "Ok"
if __name__ == '__main__':
app.run(host='50.56.174.200', port=100, debug=True)
Till next week.
Happy sending!
The Mailgunners
Learn about our Deliverability Services
Looking to send a high volume of emails? Our email experts can supercharge your email performance. See how we've helped companies like Lyft, Shopify, Github increase their email delivery rates to an average of 97%.
Last updated on August 28, 2020
Continuing Our Commitment: HTTPS Innovation And Optimization
Your Guide To Webhooks
Easier and Faster Implementation with Our Updated SDKs
Inbox Placement - Delivery Made Simple
Intelligent Email Forwarding With Mailgun
Same API, New Tricks: Get Event Notifications Just In Time With Webhooks
Lock It Down! Welcome, 2 Factor Authentication
Introducing The 5 User Roles: Keep The Riffraff Out Of Your Mailgun Account
How Quickly Can Mailgun Process My Messages? Introducing The Rapid Fire Delivery SLA
Getting Started With Mailgun: An Introduction To The Platform
InboxReady x Salesforce: The Key to a Stronger Email Deliverability
Become an Email Pro With Our Templates API
Google Postmaster Tools: Understanding Sender Reputation
Navigating Your Career as a Woman in Tech
Implementing Dmarc – A Step-by-Step Guide
Email Bounces: What To Do About Them
Announcing InboxReady: The deliverability suite you need to hit the inbox
Black History Month in Tech: 7 Visionaries Who Shaped The Future
How To Create a Successful Triggered Email Program
Designing HTML Email Templates For Transactional Emails
InboxReady x Salesforce: The Key to a Stronger Email Deliverability
Implementing Dmarc – A Step-by-Step Guide
Announcing InboxReady: The deliverability suite you need to hit the inbox
Designing HTML Email Templates For Transactional Emails
Email Security Best Practices: How To Keep Your Email Program Safe
Mailgun’s Active Defense Against Log4j
Email Blasts: The Dos And Many Don’ts Of Mass Email Sending
Email's Best of 2021
5 Ideas For Better Developer-Designer Collaboration
Mailgun Joins Sinch: The Future of Customer Communications Is Here
Always be in the know and grab free email resources!
By sending this form, I agree that Mailgun may contact me and process my data in accordance with its Privacy Policy.