0 votes
in SAP C/4HANA by (100 points)
How can I implement forgot pwd using username it should take that users email and trigger mail to that id

1 Answer

0 votes
by (260 points)
The forgotten password reset email is triggered in DefaultCustomerAccountService.forgottenPassword (you find that in commerceservicesserver.jar) in the following way:

 getEventService().publishEvent(initializeEvent(new ForgottenPwdEvent(token), customerModel));

And then there is a ForgottenPasswordEventListener.java in yacceleratorcore that does this:

     @Override

     protected void onSiteEvent(final ForgottenPwdEvent event)

     {

         final ForgottenPasswordProcessModel forgottenPasswordProcessModel = (ForgottenPasswordProcessModel) getBusinessProcessService()

                 .createProcess("forgottenPassword-" + event.getCustomer().getUid() + "-" + System.currentTimeMillis(),

                         "forgottenPasswordEmailProcess");

         forgottenPasswordProcessModel.setSite(event.getSite());

         forgottenPasswordProcessModel.setCustomer(event.getCustomer());

         forgottenPasswordProcessModel.setToken(event.getToken());

         forgottenPasswordProcessModel.setLanguage(event.getLanguage());

         forgottenPasswordProcessModel.setCurrency(event.getCurrency());

         forgottenPasswordProcessModel.setStore(event.getBaseStore());

         getModelService().save(forgottenPasswordProcessModel);

         getBusinessProcessService().startProcess(forgottenPasswordProcessModel);

     }

 

So a business process it launched to create the forgotten password email, to send it and then to remove it from the queue. Just track down from here (in the process xml and in the bean xml files) what happens next and you know what to do.

42 questions

54 answers

5 comments

255 users

SAPGURU is a community of sap experts willing to share their knowledge across a wide range of topics and areas. Are you one of them? Want to know more? Just register or subscribe on our telegram bot https://t.me/sap_bazar_bot

Categories

...