How to send an email depending on condition

  • 22 June 2018
  • 1 reply
  • 0 views

Badge

Hi all,

I have a scenario, where i need to send email depending on condition through flex task because we are using default form for approval and rejection process.        

Condition: 

1. When workflow triggers for the first time on new document upload i need to send email to all the users in the SharePoint group with the link for approval and rejection form in email body which can be accommodated. But ones the document approved by the SharePoint group member same document will be approved again by same SharePoint group member excluding the approver who approved the document first time. 

To approve the document for the second time we will be sending the email notification with a link in the email body for approval and rejection form. To send the email for the second time i need to remove the approver who approved the document in the first time.      


1 reply

Userlevel 5
Badge +14

for second approval round you would need to

- save in a list field approver from first approval

- get and enumerate users within sharepoint group. you will have to make a call to GetUserCollectionFromGroup method of Usergroup.asmx webservice - UserGroup.GetUserCollectionFromGroup method (WebSvcUserGroup) 

- remove from received list an user that approved in first round 

- assign task to that reduced list of approvers

Reply