Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Events around E-Mails #1791

Closed
pquerner opened this issue Aug 18, 2021 · 2 comments
Closed

Events around E-Mails #1791

pquerner opened this issue Aug 18, 2021 · 2 comments

Comments

@pquerner
Copy link
Contributor

Description (*)

Because of PR #1438 I was thinking about having even more events around email, because as of know its difficult (to my knowledge) to disable certain emails from sending out.
For instance I have a client which wants \Mage_Customer_Model_Customer::sendChangedPasswordOrEmail to never fire.

To do this, to my knowledge, you have to extend the full class. Which is ugly and not really that good in my opinion.

Adding more events around emails in the right places (which I currently do not know) would make it easy to disable certain emails from being sent out, right?

Expected behavior (*)

Having events in the right places added.

@rvelhote
Copy link
Contributor

As an alternative, for your consideration, the module aschroder/smtp_pro has many events related to e-mails - you can search for dispatchEvent in the module to see all of them. You also have some additional advantages such as more advanced SMTP/API integration and queueing.

@henryhayes
Copy link

You could rewrite the Customer model overwriting just the one method to fire an event, before calling the parent method. Then you could use an observer to do what you're looking to do. It's not all that messy really.

That solves your problem short term. Why not then create a feature request for "customer_email_" prefixed email events... suggesting your then one of us can implement it one go.

Example:

Mage::dispatchEvent('customer_email_password_or_email', array(
   'model'    => $this
));

@OpenMage OpenMage locked and limited conversation to collaborators Jun 1, 2023
@ADDISON74 ADDISON74 converted this issue into discussion #3293 Jun 1, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Projects
None yet
Development

No branches or pull requests

5 participants