1

Scuse if I am missing something obvious:

We send all our emails out through Mandrill (aka Mailchimp transactional emails) and it places emails On Hold if they hard or soft bounce.

We want to delete all the emails from our list that are hard bounces. How might we do this?

We could use our Mandrill report to place all the contacts with emails that are hard-bouncing into a group. But that won't help us know which of their (potentially) multiple emails to delete. We'll only know which contacts have 'an email' that is hard bouncing.

Anyone got any methods for deleting the hard bouncing emails, but only those emails?

Thanks!

1 Answer 1

1

You can do this in api explorer, e.g. https://site/civicrm/api4. (Note to set Limit to 0)

But you might want to think twice about doing this since if the bouncing email gets added again and you send it an email again (not via mandrill) it might eventually hurt your email reputation.

(Thanks to Aidan for the simplification.)

enter image description here

2
  • 2
    Just wondering why you did this with a chain instead of a simple Email.delete with a 'where' clause: civicrm_api4('Email', 'delete', [ 'where' => [ ['on_hold:name', '=', 'On Hold Bounce'] ] ]); (Habit from api3??)
    – Aidan
    Commented Nov 17, 2021 at 19:03
  • Oh ha. I think it was because I started out trying to just get the list of on hold because I can never remember which of those things are contact-level properties, and yeah api3 blurs them a bit. And then once I had it for whatever reason I didn't think to just change the action.
    – Demerit
    Commented Nov 17, 2021 at 19:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.