Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Testing webhook in postmark returns error 400 #388

Closed
mathieuser opened this issue May 24, 2023 · 7 comments
Closed

Testing webhook in postmark returns error 400 #388

mathieuser opened this issue May 24, 2023 · 7 comments
Labels
question Further information is requested

Comments

@mathieuser
Copy link

When I use the webhook in Postmark, and I test it from there, it returns a 400 error. I have a hard time understanding what's up.

Thanks for your help!

Schermafbeelding 2023-05-24 om 12 00 57
@mathieuser mathieuser added the question Further information is requested label May 24, 2023
@bencroker
Copy link
Collaborator

bencroker commented May 24, 2023

Can you check the /logs/campaign.log file for any clues?

@mathieuser
Copy link
Author

mathieuser commented May 24, 2023

I cleared the logs, hen logged in so a web.log was created, then I sent the request from postmark again, but no campaign.log got created apparently... So I don't think it gets into Craft CMS at all

@mathieuser
Copy link
Author

Hmm so when I send a bounce the campaign.log file is created and it receives it, though still getting the 400 error in Postmark.

[2023-05-24 12:31:15] Webhook request: { "Metadata": { "example": "value", "example_2": "value" }, "RecordType": "Bounce", "ID": 42, "Type": "HardBounce", "TypeCode": 1, "Name": "Hard bounce", "Tag": "Test", "MessageID": "00000000-0000-0000-0000-000000000000", "ServerID": 1234, "MessageStream": "outbound", "Description": "The server was unable to deliver your message (ex: unknown user, mailbox not found).", "Details": "Test bounce details", "Email": "john@example.com", "From": "sender@example.com", "BouncedAt": "2023-05-24T10:31:14Z", "DumpAvailable": true, "Inactive": true, "CanActivate": true, "Subject": "Test subject" }

@bencroker
Copy link
Collaborator

Are you running the latest 2.7.0 version of Campaign?

@mathieuser
Copy link
Author

I just updated to 2.7.0, but no changes on this regard so it seems!

@mathieuser
Copy link
Author

I've done a test through RequestBin, with the same JSON data as in postmark, and i'm getting this response:

Schermafbeelding 2023-05-24 om 17 10 33

@bencroker
Copy link
Collaborator

bencroker commented May 24, 2023

I've done a test through RequestBin, with the same JSON data as in postmark, and i'm getting this response:

That error is to be expected, since the request came from an IP address other than one of Postmark’s designated IPs.

The issue turned out to be that john@example.com is not a valid contact in the system. I changed this behaviour so that a successful response is returned, regardless of whether the contact exists, in bb7cc6b and released in version 2.7.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants