2017-08-15 79 views
0

我想將電子郵件發送給輔助收件人,以便他們可以在第一個收件人簽名後簽名。我將如何實現這一點?這是我的東西嵌入式視圖的工作流程

signer.Tabs = new Tabs(); 
     signer.Tabs.SignHereTabs = new List<SignHere>(); 
     var signHere = new SignHere(); 
     signHere.DocumentId = "1"; 
     signHere.PageNumber = "1"; 
     signHere.RecipientId = "1"; 
     signHere.AnchorUnits = "pixels"; 
     signHere.AnchorXOffset = "150"; 
     signHere.AnchorYOffset = "5"; 

     signHere.AnchorString = "PARTICIPANT SIGNS"; 
     signHere.Optional = "true"; 
     signer.Tabs.SignHereTabs.Add(signHere); 
     envDef.Recipients = new Recipients(); 
     envDef.Recipients.Signers = new List<Signer>(); 
     envDef.Recipients.Signers.Add(signer); 
     EnvelopeSummary envelopeSummary = envelopesApi.CreateEnvelope(accountId, envDef); 



     var viewOptions = new RecipientViewRequest() 
     { 
      //ReturnUrl = "https://" 
      ReturnUrl = "https://www.docusign.com/devcenter", 
      ClientUserId = clientId, // must match clientUserId set in step #2! 
      AuthenticationMethod = "email", 
      UserName = user.FullName, 
      Email = user.Email 
     }; 

上面的用戶對象只是一個自定義類,其中包含我們系統中的用戶信息。如果我只是添加另一個更高的clientuserid簽名,在第一次簽名後會自動將該電子郵件發送給該用戶?

回答

0

指定clientUserId表示收件人被認爲是embedded recipient。沒有電子郵件將被髮送到嵌入式收件人。

對於您的用例,添加另一個沒有clientUserId和更高路由順序的收件人。第二位收件人將在第一位收件人完成簽名後自動收到電子郵件。

注意:對每個收件人使用不同的錨點字符串。

public void CreateEnvelopeWithTwoRecipients() 
    { 
     string accountID = Init(); //Initialization Code 

     byte[] fileBytes = System.IO.File.ReadAllBytes(@"C:\temp\Agreement.pdf"); 
     var envDef = new EnvelopeDefinition() 
     { 
      EmailSubject = "My Envelope Subject", 
      Status = "sent", 
      Documents = new List<Document>() 
      { 
       new Document() 
       { 
        DocumentBase64 = System.Convert.ToBase64String(fileBytes), 
        Name = "Contract", 
        DocumentId = "1" 
       } 
      }, 
      Recipients = new Recipients() 
      { 
       Signers = new List<Signer>() 
       { 
        new Signer() 
        { 
         Email = "[email protected]", 
         Name = "Jane Doe", 
         RecipientId = "1", 
         RoutingOrder = "1", 
         clientUserId = "10000" 
         Tabs = new Tabs() 
         { 
          SignHereTabs = new List<SignHere>() 
          { 
           new SignHere() 
           { 
            DocumentId = "1", 
            AnchorXOffset = "150", 
            AnchorXOffset = "5", 
            AnchorString = "PARTICIPANT SIGNS", 
            AnchorUnits = "pixels", 
            Optional = "true" 

           } 
          } 
         } 
        }, 
        new Signer() 
        { 
         Email = "[email protected]", 
         Name = "john smith", 
         RecipientId = "2", 
         RoutingOrder = "2", 
         Tabs = new Tabs() 
         { 
          SignHereTabs = new List<SignHere>() 
          { 
           new SignHere() 
           { 
            DocumentId = "1", 
            AnchorXOffset = "150", 
            AnchorXOffset = "5", 
            AnchorString = "Second PARTICIPANT SIGNS", 
            AnchorUnits = "pixels", 
            Optional = "true" 
           } 
          } 
         } 
        } 
       } 
      } 
     }; 

     EnvelopesApi envelopesApi = new EnvelopesApi(); 
     EnvelopeSummary envelopeSummary = envelopesApi.CreateEnvelope(accountID, envDef); 
    }