cancel
Showing results for 
Search instead for 
Did you mean: 

I need to send an email when a user clicks on a particular link on the site. Can someone list down the steps that needs to be followed.

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

former_member387866
Active Contributor
0 Kudos

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

Answers (1)

Answers (1)

Marko_salonen
Contributor
0 Kudos

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 :)

former_member387866
Active Contributor
0 Kudos

Hopefully it works out for you Marko.