Skip to content
Advertisement

How to send an e-mail after adding the product to the cart in magento 2?

Unfortunately, so far I am a complete beginner in creating a module in magento. I need to send an email after adding the item to the cart.

As I understand it, I need to use the checkout_cart_product_add_after event

I created some files, but I don’t understand how to send an email after adding the item to the cart

My/Module/etc/events.xml

JavaScript

My/Module/Observer/SendEmailForCart.php

JavaScript

My/Module/Helper/Email.php

JavaScript

Please tell, what code I need to write in the Email.php file? And do I need to create any additional files or modify the ones I showed above?

Advertisement

Answer

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement