mediabeastnz / craft-commerce-abandoned-cart

Abandoned Cart plugin for Craft Commerce 2
Other
1 stars 15 forks source link

Email Blacklist Event #59

Closed samhibberd closed 8 months ago

samhibberd commented 2 years ago

Hey, would you be open to a PR or willing to add an event that would allow us to add emails to the blacklisted emails stored in the plug-in settings, before they are used in the abandoned cart query?

We need to support unsubscribing directly from emails, and project config makes this tricky to implement as a direct update of the plugin settings.

mediabeastnz commented 2 years ago

This can be done using environment variables is that makes it easier for you? Otherwise I can look to add an event that would allow other developers to tap into the the blacklist.

samhibberd commented 2 years ago

An event would be awesome, fairly high traffic site and the list is growing (we currently are using env vars).

Many thanks.

joshparylak commented 1 year ago

@mediabeastnz We have the same use case here, we need to support unsubscribing directly from emails. Any idea when/if this ability is being added?

joshparylak commented 9 months ago

@mediabeastnz Just wanted to check back in here and see if we have any options for an event to tap into?

samhibberd commented 8 months ago

@mediabeastnz see this PR https://github.com/mediabeastnz/craft-commerce-abandoned-cart/pull/74 fixes this would be great to see this implemented so we can handle unsubscribe / exclusions ourselves!

mediabeastnz commented 8 months ago

Thanks to @lenvanessen this can now be done via an event.

Event::on(
    Carts::class,
    Carts::EVENT_BEFORE_MAIL_SEND,
    function (BeforeMailSend $event) {
        // implement
    }
);