• Magento 2

    Magento 2 import email address to Newsletter from csv

    Magento 2 import email address to Newsletter from csv. I have a requirement to import email is from CSV and import the email ids to Newsletter Subscriber list from csv. Write a PHP script which will import Newsletter subscriber from CSV. In this script, first i have read the email ids  from Csv , Then  first  check an email is exits  as customer Using Magento\Customer\Api\AccountManagementInterface ‘s   function isEmailAvailable($emailId,$websiteId) and depends  on customer types Guest ( mean guest Not register) and register, i have added  the email  to  subscriber list. For add an email to the subscriber list, we need to call factory class Magento\Newsletter\Model\SubscriberFactory  and need to Customer.Guest customer  use $_subscriberFactory->create()->subscribe($Email);   and register customer ,use…