Hi Rohith,

When Considering API Manager with workflows,
If you want to send an email to the approved user where the admin approves
the event you can implement a custom executor extending the workflow
executor class of the particular event
e.g. If you want to send an email to the user when the admin approves the
Application registraion you can create a custom executor calss extending
ApplicationRegistrationWSWorkflowExecutor.

There you can override execute(WorkflowDTO workflowDTO)  method and achieve
that as follows.


 @Override
public void execute(WorkflowDTO workflowDTO) throws WorkflowException {

ApplicationRegistrationWorkflowDTO appDTO =
(ApplicationRegistrationWorkflowDTO) workflowDTO;

 String emailSubject = appDTO.getKeyType() + "Application Registration";

 String emailText = "Appplication " + appDTO.getApplication().getName() + "
is registered for " +
   appDTO.getKeyType() + " key by user " + appDTO.getUserName();

 try {
   //Implementation of email sending here e.g. EmailSender.SendEmail Method

 } catch (MessagingException e) {
  // TODO Auto-generated catch block
  e.printStackTrace();
 }

 //SEND EMAIL
 super.execute(workflowDTO);
}
We can use this way to send emails to the admin user as well.



On Fri, Jul 17, 2015 at 12:35 PM, rohit <rohitab...@gmail.com> wrote:

> Hello All,
>
> I have been working on wso2 API Manager for some time now. I have added a
> user sign up workflow to it. Now the problem that I am facing is this :
> I have a scenario wherein, once the admin approves the request from the
> admin-dashboard, that is admin can either Approve/Reject the sign up
> request. Once he does so, an email must be sent to the appropriate user.
> This is what I need to achieve.
> (I have also tried the customized subscription workflow provided by wso2,
> and recieved an email whenever I subscribe to an API, But here the email
> was
> sent without any human intervention. There is a SubscriptionWorkflowDTO
> class that contains information about suscriptions created)
> Now I have created a service in esb that is capable of sending an email to
> a
> user. But where I am still facing an issue is, how to *capture the
> admin-dashboard events* that is* once the admin approves/rejects and
> clicks
> on the complete button*, i need to invoke email sending service in esb with
> the appropriate admin response. How do I achieve this? Any help will be
> greatly appreciated
> P.s : I am looking into the source code and trying to modify it to suit my
> situation, but things are not going in my way.
>
>
>
> --
> View this message in context:
> http://wso2-oxygen-tank.10903.n7.nabble.com/Customizing-Workflows-in-wso2-API-Manager-tp121859.html
> Sent from the WSO2 Development mailing list archive at Nabble.com.
> _______________________________________________
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>



-- 
Thanks & Regards,

*Chamalee De Silva*
Software Engineer
*WS**O2* Inc. .:http://wso2.com

Office   :- *+94 11 2145345 <%2B94%2011%202145345>*
mobile  :- *+94 7 <%2B94%2077%202782039>1 4315942*
_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to