- What's new
Inbox Placement - Delivery Made Simple
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
It's easy to get started. And it's free.
See what you can accomplish with the world’s best email delivery platform.
Last updated on August 28, 2020
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
A Practical Guide To Using Mailgun’s Webhooks
Mailgun Announces Improvements To Logs Feature To Increase Visibility Into Deliverability Problems
Mailgun Rolls Out Changes To Email Validation API Including New Features And Pricing Model
Mailpets: For The Love Of Animals
Make Email Accessibility Your New Year’s Resolution
Sunset Policies: Allowing Unengaged Recipients to Ride Off into the Sunset
Email's Best of 2020
Catch-All Domain Support Is Now Available In Email Validations
The Best Time To Send Emails: Cracking The Code
Tips for Building Better Holiday Email Templates
Happy Festivus: Email Deliverability For The Holiday Season
The Basics of Email Subdomains
A Word of Caution For Laravel Developers
Make Email Accessibility Your New Year’s Resolution
Sunset Policies: Allowing Unengaged Recipients to Ride Off into the Sunset
Email's Best of 2020
How To Improve Email Open Rates
Preparing Your Email Infrastructure Correctly
4 Tips To Improve Your Email Deliverability In 2020
COVID-19 Email Communications Dos and Don’ts
How To Use Parallel Programming
Mailgun’s COVID-19 Plan of Action
Password Meters Are Not For Humans
Always be in the know and grab free email resources!
Mailgun is committed to protecting your privacy. Please read ourPrivacy Policybefore providing us with your details.