Disable email notification for specific customers Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) Announcing the arrival of Valued Associate #679: Cesar Manara Unicorn Meta Zoo #1: Why another podcast?Get order entity inside invoice emailMagento 2 : Is there any way to disable Welcome Email after signupMagento 2: How to Send Reset Password Mass Email to Customers ProgrammaticallyMagento 2: Disable “Cash on delivery” for downloadable productsMagento 2 - Is there any way to disable Welcome Email after signup for specific store or websiteMagento 2 disable checkout for certain customersWelcome Email 1.9 disable sending this emailMagento 2 validate customer session with extra parametersHaving problems with Magento 2.2.4 outgoing email to customersShowing email in “Shipping Address”
What LEGO pieces have "real-world" functionality?
What would be Julian Assange's expected punishment, on the current English criminal law?
Array/tabular for long multiplication
Single author papers against my advisor's will?
Why don't the Weasley twins use magic outside of school if the Trace can only find the location of spells cast?
Interesting examples of non-locally compact topological groups
Limit for e and 1/e
Can a monk deflect thrown melee weapons?
Is there a documented rationale why the House Ways and Means chairman can demand tax info?
Why is "Captain Marvel" translated as male in Portugal?
How to colour the US map with Yellow, Green, Red and Blue to minimize the number of states with the colour of Green
What did Darwin mean by 'squib' here?
Can I throw a sword that doesn't have the Thrown property at someone?
Can smartphones with the same camera sensor have different image quality?
Two different pronunciation of "понял"
3 doors, three guards, one stone
What computer would be fastest for Mathematica Home Edition?
What do you call a plan that's an alternative plan in case your initial plan fails?
How do you clear the ApexPages.getMessages() collection in a test?
Why does tar appear to skip file contents when output file is /dev/null?
Stars Make Stars
Slither Like a Snake
Did the new image of black hole confirm the general theory of relativity?
Keep going mode for require-package
Disable email notification for specific customers
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)
Announcing the arrival of Valued Associate #679: Cesar Manara
Unicorn Meta Zoo #1: Why another podcast?Get order entity inside invoice emailMagento 2 : Is there any way to disable Welcome Email after signupMagento 2: How to Send Reset Password Mass Email to Customers ProgrammaticallyMagento 2: Disable “Cash on delivery” for downloadable productsMagento 2 - Is there any way to disable Welcome Email after signup for specific store or websiteMagento 2 disable checkout for certain customersWelcome Email 1.9 disable sending this emailMagento 2 validate customer session with extra parametersHaving problems with Magento 2.2.4 outgoing email to customersShowing email in “Shipping Address”
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
Please can any one help me on this,
I would like to disable email notofication for customers, which have a flag non_email_customers set to true.
I Have Try this way. i have created a plugin for: MagentoFrameworkMailsendTransportInterface::sendMessage()
but I don't know how to get customer object there. Getting it from customer session is not the best solution I suppose beacuse of mail from adminhtml area. Any ideas how to resolve this issue?
magento2 email magento2.3
add a comment |
Please can any one help me on this,
I would like to disable email notofication for customers, which have a flag non_email_customers set to true.
I Have Try this way. i have created a plugin for: MagentoFrameworkMailsendTransportInterface::sendMessage()
but I don't know how to get customer object there. Getting it from customer session is not the best solution I suppose beacuse of mail from adminhtml area. Any ideas how to resolve this issue?
magento2 email magento2.3
add a comment |
Please can any one help me on this,
I would like to disable email notofication for customers, which have a flag non_email_customers set to true.
I Have Try this way. i have created a plugin for: MagentoFrameworkMailsendTransportInterface::sendMessage()
but I don't know how to get customer object there. Getting it from customer session is not the best solution I suppose beacuse of mail from adminhtml area. Any ideas how to resolve this issue?
magento2 email magento2.3
Please can any one help me on this,
I would like to disable email notofication for customers, which have a flag non_email_customers set to true.
I Have Try this way. i have created a plugin for: MagentoFrameworkMailsendTransportInterface::sendMessage()
but I don't know how to get customer object there. Getting it from customer session is not the best solution I suppose beacuse of mail from adminhtml area. Any ideas how to resolve this issue?
magento2 email magento2.3
magento2 email magento2.3
edited yesterday
Magento_Bhurio
382110
382110
asked 2 days ago
Wojciech KaWojciech Ka
15014
15014
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
You can get a list of all the customers with this code -
public function __construct(
...
MagentoCustomerModelResourceModelCustomerCollectionFactory $customerFactory
...
)
...
$this->_customerFactory = $customerFactory;
...
/**
* Get customer collection
*/
public function getCustomerCollection()
return $this->_customerFactory->create();
Use this as -
$customerCollection = $this->getCustomerCollection();
foreach ($customerCollection as $customer)
echo $customer->getEmail(); //Or any other method
Since non_email_customers sounds like a user defined field, you should be able to access it as $customer->getDataByKey('non_email_customers');
To get a list of all the methods available on the $customer object, use get_class_methods($customer)
Hope this helps!
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "479"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f269935%2fdisable-email-notification-for-specific-customers%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
You can get a list of all the customers with this code -
public function __construct(
...
MagentoCustomerModelResourceModelCustomerCollectionFactory $customerFactory
...
)
...
$this->_customerFactory = $customerFactory;
...
/**
* Get customer collection
*/
public function getCustomerCollection()
return $this->_customerFactory->create();
Use this as -
$customerCollection = $this->getCustomerCollection();
foreach ($customerCollection as $customer)
echo $customer->getEmail(); //Or any other method
Since non_email_customers sounds like a user defined field, you should be able to access it as $customer->getDataByKey('non_email_customers');
To get a list of all the methods available on the $customer object, use get_class_methods($customer)
Hope this helps!
add a comment |
You can get a list of all the customers with this code -
public function __construct(
...
MagentoCustomerModelResourceModelCustomerCollectionFactory $customerFactory
...
)
...
$this->_customerFactory = $customerFactory;
...
/**
* Get customer collection
*/
public function getCustomerCollection()
return $this->_customerFactory->create();
Use this as -
$customerCollection = $this->getCustomerCollection();
foreach ($customerCollection as $customer)
echo $customer->getEmail(); //Or any other method
Since non_email_customers sounds like a user defined field, you should be able to access it as $customer->getDataByKey('non_email_customers');
To get a list of all the methods available on the $customer object, use get_class_methods($customer)
Hope this helps!
add a comment |
You can get a list of all the customers with this code -
public function __construct(
...
MagentoCustomerModelResourceModelCustomerCollectionFactory $customerFactory
...
)
...
$this->_customerFactory = $customerFactory;
...
/**
* Get customer collection
*/
public function getCustomerCollection()
return $this->_customerFactory->create();
Use this as -
$customerCollection = $this->getCustomerCollection();
foreach ($customerCollection as $customer)
echo $customer->getEmail(); //Or any other method
Since non_email_customers sounds like a user defined field, you should be able to access it as $customer->getDataByKey('non_email_customers');
To get a list of all the methods available on the $customer object, use get_class_methods($customer)
Hope this helps!
You can get a list of all the customers with this code -
public function __construct(
...
MagentoCustomerModelResourceModelCustomerCollectionFactory $customerFactory
...
)
...
$this->_customerFactory = $customerFactory;
...
/**
* Get customer collection
*/
public function getCustomerCollection()
return $this->_customerFactory->create();
Use this as -
$customerCollection = $this->getCustomerCollection();
foreach ($customerCollection as $customer)
echo $customer->getEmail(); //Or any other method
Since non_email_customers sounds like a user defined field, you should be able to access it as $customer->getDataByKey('non_email_customers');
To get a list of all the methods available on the $customer object, use get_class_methods($customer)
Hope this helps!
answered yesterday
coderGeekcoderGeek
266
266
add a comment |
add a comment |
Thanks for contributing an answer to Magento Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f269935%2fdisable-email-notification-for-specific-customers%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown