- What's new
Continuing Our Commitment: HTTPS Innovation And Optimization
This week, in addition to writing about what we learned open sourcing a major part of Mailgun, we released a new feature we think you’ll appreciate: a postbin for debugging your webhooks.
We try not to suffer too much from not-invented-here syndrome at Mailgun (we’re engineers though, so it’s hard) and for years, there were a couple Postbin’s that we used regularly, and encouraged our customers to use, for debugging webhooks. Our favorite was postbin.ryanbigg.com because it was simple, and the POSTs were easy-to-read. But it’s no longer available, and another that we liked was recently redesigned making it harder to use. So we decided to make our own, focusing on usability and simplicity.
If you go to http://bin.mailgun.net, you’ll now have the ability to create Postbin’s that allow you to easily debug your webhooks, Mailgun-related or otherwise.
Ability to create multiple Postbins, each with their own permalink. This can make it easier to debug multiple webhooks
Each post within the Postbin has its own permalink too. This makes it easy to pass around your POST, for instance, when talking to Mailgun support.
Remember, since Mailgun let’s you test all your webhooks with a sample POST, you can enter your PostBin url in the Mailgun control panel and receive your test POST before coding anything.
In addition, the Mailgun PHP SDK has been modified to allow the Postbin as a destination, making it easy to see exactly what the SDK is posting to Mailgun’s API. Head over to the PHP SDK “Debugging” section for details.
Overtime, we’re hoping to integrate the Mailgun Postbin directly into your control panel, so that you can test your webhooks to a private postbin without having to enter a URL. Until that time, keep the following caveats in mind:
Your POSTs to bin.mailgun.net are public, so don’t post anything confidential or that you wouldn’t want your mom to see.
Your data is deleted after 5 days max and maybe sooner, so don’t store anything you really really need here.
For developers who wish to provision a Postbin programatically, an API is available for the Postbin. Here are the available endpoints:
1POST http://bin.mailgun.net/api/new2Creates a new Postbin3Response:4{ 5 "url": "http://bin.mailgun.net/b50299cc"6}
1POST http://bin.mailgun.net/api/<id&gt;2Stores data in the Postbin3Response:4{5 "message": "Post received. Thanks!"6}
1DELETE http://bin.mailgun.net/api/<id&gt;2Deletes a Postbin3Response:4{5 "message": "Bin <id> deleted"6}
1GET http://bin.mailgun.net/api/<id&gt;2Retrieves the Postbin data3Response:4[5 {6 "id": 153,7 "params": "{"recipient":"test@example.com","sender":"travis@example.com","stripped-text":"A POST!","timestamp":"1358041467"}",8 "created_at": 1385798101,9 "bin_id": 5910 }11]
Once you’re finally ready to accept POSTs for real, you can use or modify this flask app to accept your POSTs:
1from flask import Flask2from flask import request3app = Flask(__name__)45@app.route('/mailgun-tracking', methods=['GET', 'POST'])6def tracking():7 # access some of the email parsed values:8 request.form['recipient']9 request.form['from']10 request.form['subject']1112 # extended parameters13 request.form['Message-Id']14 request.form['message-headers']15 request.form['timestamp']16 request.form['body-plain']17 request.form['stripped-html']18 request.form['stripped-text']19 request.form['stripped-signature']2021 return "Ok"2223if __name__ == '__main__':24 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
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
A Practical Guide To Using Mailgun’s Webhooks
Mailgun Announces Improvements To Logs Feature To Increase Visibility Into Deliverability Problems
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.