proexchange / com.pesc.sparkpost

Integrates SparkPost to CiviCRM, so email can be sent out over the SparkPost service and bounces can be processed in CiviCRM
Other
9 stars 5 forks source link

Bounce doesn't seem to be reflected in CiviCRM #6

Closed laryn closed 8 years ago

laryn commented 8 years ago

I set up a contact with a nonexistent email address and did a "Send an email" action. The message shows as a bounce in SparkPost, but I see no evidence that the bounce was reflected in CiviCRM after the Scheduled Job is run.

Here's the events line of my Scheduled Job, underneath the api_key and friendly_froms:

events=bounce,delay,policy_rejection,out_of_band,spam_complaint

Am I missing a step?

joseltorres commented 8 years ago

It only works for the bulk emails (civimail). CiviCRM only includes b.###.###.[hash]@exmaple.org return-path header during bulk mailings. We basically insert that return-path header into tags that we can then query from sparkpost with their API. Try adding the contact to a group for mailing and send out bulk mailing. We may work in these type of emails later, but right now we're focused on bulk emails.

laryn commented 8 years ago

Hmm... still doesn't seem to be working even from CiviMail. I will try to test further later. I guess this is a different method than the Mandrill extension, which uses a webhook on bounce events to notify CiviCRM. (I see SparkPost does allow webhooks, so perhaps that could be used in the future)

joseltorres commented 8 years ago

did you make sure to fill in the correct parameters for the scheduled job, enable it, and execute it?

laryn commented 8 years ago

Yes, I have info in the api_key, friendly_froms and the events parameter as above. I submitted the mailing, manually ran the Mailings job, then waited until I saw the bounce in SparkPost and manually executed the SparkPost scheduled job.

joseltorres commented 8 years ago

What does the job log say for the scheduled job? you can email me at jtorres [at] pesc [dot] com... I'd like to see know what is going on to try and fix an issue if it exist.

a few other things to check: in the sparkpost api do you see something like this in the bounce event? "rcpt_meta": { "civi-rp": "b.557.3204.7e8e795fc2298176@example.org" },

also, you need to be on civi 4.6+

laryn commented 8 years ago

This is on 4.6. Here's the summary and I'll email you with more detail.

Entity: SparkPost Action: Fetchbounces Summary Finished execution of SparkPost Fetch Bounces with result: Success (a:0:{})

laryn commented 8 years ago

The issue was that the friendly_froms parameter didn't match the from address of the mailing exactly.

joseltorres commented 8 years ago

friendly_froms is a case-sensitive, comma-separated list (ex: info@example.com,marketing@example.com,director@example.com)