on 06-15-2016 7:07 PM
I have a requirement where if a product is out of stock then a "Notify Me" button is displayed on the PDP page. Once a user clicks on this button , a popup appears which will ask for the users email id. once the user enters his correct email id , and hits submit. An email should go to the mail-id that the user had entered , saying that he would be intimated once product is available. can someone provide me the complete steps to achieve this.. or provide me a link that I could refer to in order to achieve this
Hi Rahul,
You need to use the EmailService, specifically the createEmailMessage(...)
and send(...)
methods.
You'll need to create a many-to-many relationship between the Product and the User, or EmailAddress. This will store the Users that are awaiting on the product.
Then you'll need to create an Interceptor that will trigger when the Stock of the Product is replaced, that will send the "Your Product is back in Stock" e-mail to the list of e-mails awaiting on that product.
You'll need to decide when to remove the Users waiting on the Product, after the EMail is sent, or when the user orders the product.
Another consideration the, Future Stock should be greater than, or equal to, the number of e-mail addresses waiting on the product.
Regards,
Luke
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Luke, agree on almost everything except the last recommendation 🙂 Of course you want to send a email as soon as possible but make sure the text says something that there is not so many products to trigger action , then you surely get convertion :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
5 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.