putyourlightson / craft-campaign

Send and manage email campaigns, contacts and mailing lists in Craft CMS.
https://putyourlightson.com/plugins/campaign
Other
64 stars 24 forks source link

How to properly set up a AWS SES webhook #424

Closed scandella closed 11 months ago

scandella commented 11 months ago

I'm sorry, I can't get any bounced notifications from AWS SES into Campaign. All campaign shows a zero bounced score, even when I test with some fake mail addresses. Although, I think I've configured SES and SNS correctly (see screenshots below). But AWS is such a maze (a mess?)… How can I debug this?

Thanks for your help.

Settings in SES

CleanShot 2023-10-10 at 22 12 47@2x CleanShot 2023-10-10 at 22 12 19@2x

Settings in SNS

CleanShot 2023-10-10 at 22 08 16@2x
philipboomy commented 11 months ago

I am using AWS and I got it working. I am seeing both bounced and complains.

Just to confirm. I can see the verified status but you are sending through live account right?

I have compared your setup with mine and I can see 2 things which are different. I am not sure they are the reason but trying to rule out anything.

In your first screenshot. I am using the same "topic" for both feedback types. Not sure if this makes a difference.

In your last screenshot I do not have "Raw message delivery" enabled.

Could you test if that makes any difference?

scandella commented 11 months ago

@philipboomy Thanks for your answer. I've disabled "Raw message delivery" and the bounced notifications works now! I think this option is enabled by default so it is worth knowing it.

However, I have some inaccurate numbers in the report window: the total count for "Reject" shows 0, even if there are some rejected mail showing up. Do you experience the same?

Thanks a lot for your advice.

CleanShot 2023-10-11 at 17 35 16@2x CleanShot 2023-10-11 at 17 37 11@2x

bencroker commented 11 months ago

However, I have some inaccurate numbers in the report window: the total count for "Reject" shows 0, even if there are some rejected mail showing up.

Are you running the latest version of Campaign 2?

scandella commented 11 months ago

I think I'm up to date: currently running Campaign 2.9.0 with Craft Craft Pro 4.5.6.1

bencroker commented 11 months ago

That should work then, I’m not sure why it didn’t. Can you check whether the value was updated in the campaign_campaigns database table?

scandella commented 11 months ago

It appears that the bounced column campaign_campaigns database table is filled with zero whereas some contacts have been marked "bounced"

bencroker commented 11 months ago

Assuming the bounce came through the webhook this should work. There is a campaign/reports/sync console command that will sync up the stats. I’ve added unsubscribed, complained and bounced counts in https://github.com/putyourlightson/craft-campaign/commit/104403d1c116b2e7f87ff2a60203df3bb6440694 for the next release.

scandella commented 11 months ago

Nice. I will try this.

bencroker commented 11 months ago

Released in 2.9.1.

scandella commented 11 months ago

Thanks. it worked! Where can I found some doc about the various console command?

bencroker commented 11 months ago

This particular console command was added as part of the fix as discussed in https://github.com/putyourlightson/craft-campaign/issues/371. All it does is re-sync the contact activity back to the campaign element. It is not documented as the underlying should be resolved.