dotmailer / dotmailer-magento2-extension

The official Dotdigital for Magento2 extension
https://dotdigital.com/integrations/magento
MIT License
48 stars 63 forks source link

Unsubscribe contact with marketing preferences #537

Closed ahasAmp closed 5 years ago

ahasAmp commented 5 years ago

I am using dotmailer-magento2-extension to subscribe contacts to an address book with their marketing preferences using bulk update like this:

Email,emailType,Preference:Motorsport,Preference:Performance,Preference:Motorcycle,Preference:Tools_and_Workshop, ahasamp@gmail.com,Html,1,1,1,1,"United Kingdom"

Now when I try to unsubscribe the contact, the unsubscribe functionality removes the contact from the address book but he still exist in marketing preferences lists.

Could you advice what is the best way to unsubscribe a contact from address book and marketing preferences using dotmailer-magento2-extension?

simon-letch commented 5 years ago

What api method are you using to unsubscribe the contact?

ahasAmp commented 5 years ago

I am using: Magento\Newsletter\Model\Subscriber::unsubscribeCustomerById()

Then the Importer Sync cron

ahasAmp commented 5 years ago

I used: $this->contactResource->delete($contactModel); and it worked.