Comments (11)
I know I'm a bit late for this, but isn't this technically a bug in the Mailgun API code?
from mailgun-go.
I think so. The code in question is a SMTP reply code (and the RFC states that they are three digits) and should only be an integer.
The question remains if this is better to solve in this library or a fix in Mailgun API is a possibility?
from mailgun-go.
Is there a workaround for this? I'm trying to figure out how to deal with bounces in Go.
from mailgun-go.
I thought a fix for this issue was already applied. :( I'm hoping the issue was left open by accident. Stand by.
from mailgun-go.
I'm trying to submit a PR for it now. Hang tight.
from mailgun-go.
An SMTP reply consists of a three digit number (transmitted as
three alphanumeric characters)
This means that they should be transmitted as characters (not one integer), but they should by no means be quoted (because then it wouldn't consist of three digit numbers). I feel like this should be fixed in the Mailgun API, as it's their code that's faulty, and not the Go code that should cope. Thoughts @mbanzon, @sam-falvo ?
from mailgun-go.
As I understood it changing this on the Mailgun side would introcude a breaking change in the API. As I see it the only option would be to have a workaround in the library (perhaps with a helper function - for those places/applications that require an actual integer response code).
from mailgun-go.
I have a PR that has so far gone unreviewed; thinking of just committing it. It does break the API of the mailgun-go library though, because it turns that field from an integer to an interface{}. In exchange for this, though, it introduces a getter function which does return a proper integer along with an error.
See https://github.com/mailgun/mailgun-go/pull/38/files#diff-ceabd71e327239278abe0bc6cd261565R39
If someone can please review and let me know if this will meet your needs, I can just merge this myself without Mailgun's explicit OK, as this issue seems to be very low priority. Thanks! @EtienneBruines @mbanzon
from mailgun-go.
LGTM. Perhaps the testing-function should also check on parsed JSON? (for the weird (and possibly non-existing) scenario that the type doesn't get resolved correctly? )
from mailgun-go.
lgtm
from mailgun-go.
I believe that's the last test case (where we expect a syntax error). I'll commit the change, but if the test can be improved, let me know. :) Thanks!
from mailgun-go.
Related Issues (20)
- Templates - Passing nested values as X-Mailgun-Variables HOT 1
- How to send LinkedResources? HOT 1
- AddAttachment not sending multiple attachments HOT 3
- ListMembers: vars duplicated on subsequent pages HOT 1
- Remove dependancy on Chi
- Make fields public in struct `mailgun.Message`. HOT 3
- SetDeliveryTime Ignored HOT 1
- Change response for `VerifyDomain` method from (string, error) to (DomainResponse, error) HOT 2
- How to convert json stored messages to url.Values HOT 1
- Make properties on Message struct publicly accessible HOT 2
- missing `result` in email validation response HOT 4
- VerifyAndReturnDomain is missing from the Mailgun interface
- Validate domain in mg.Send()
- Allow to use : in domain for testing HOT 2
- Inline image example should have img tag in html input HOT 1
- events.ClientInfo is missing the `bot` field HOT 2
- Add 'web_scheme' as a primary attribute to Domain HOT 3
- Set preferred reply method for mailing lists missing HOT 1
- [Feature Request] Add Send Time Optimization (STO) Feature HOT 3
- Ability to add multiple webhooks for same events.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mailgun-go.