简体   繁体   English

CarbonCopy到Gmail地址似乎不起作用

[英]CarbonCopy to a gmail address doesn't seem to work

I'm using a DocuSign Java SDK and need the functionality of CarbonCopy as I need to send every document to a person within our company other than a Signer. 我正在使用DocuSign Java SDK,并且需要CarbonCopy的功能,因为我需要将每个文档发送给公司内除签名者以外的其他人。

So when I use the gmail address for the Signer the email is sent. 因此,当我将Gmail地址用于签名者时,电子邮件就会发送出去。 But when I use the gmail address for the CarbonCopy recipient the email is never sent and I do not get an error. 但是,当我为CarbonCopy收件人使用gmail地址时,电子邮件从不会发送,也不会收到错误消息。 The envelope id is returned as if everything went fine. 信封ID会返回,好像一切正​​常。

Is there anything that I'm missing? 有什么我想念的吗? Is it possible to make that work? 有可能使这项工作吗?

     // login call available off the AuthenticationApi
     AuthenticationApi authApi = new AuthenticationApi();

     // login has some optional parameters we can set
     AuthenticationApi.LoginOptions loginOps = authApi.new LoginOptions();
     loginOps.setApiPassword("true");
     loginOps.setIncludeAccountIdGuid("true");
     LoginInformation loginInfo = authApi.login(loginOps);

     // note that a given user may be a member of multiple accounts
     List<LoginAccount> loginAccounts = loginInfo.getLoginAccounts();

     String accountId = loginAccounts.get(0).getAccountId();

     Path path = Paths.get(sFilePath);
     byte[] PDFContents = Files.readAllBytes(path);

     // Create an envelope that will store the document(s), field(s), and recipient(s)
     EnvelopeDefinition envDef = new EnvelopeDefinition();
     envDef.setEmailSubject("Please sign this document sent from Java SDK)");

     // Add a document to the envelope
     Document doc = new Document();  
     String base64Doc = DatatypeConverter.printBase64Binary(PDFContents);
     doc.setDocumentBase64(base64Doc);
     doc.setName("MaterialRequisition.pdf");    // can be different from actual file name
     doc.setDocumentId("1");

     List<Document> docs = new ArrayList<Document>();
     docs.add(doc);
     envDef.setDocuments(docs);

     // add a recipient to sign the document, identified by name and email we used above
     Signer signer = new Signer();
     signer.setEmail(sApproverEmail);
     signer.setName(sApproverName);
     signer.setRecipientId("1");

     CarbonCopy cc = new CarbonCopy();
     cc.setEmail(sCCEmail);
     cc.setName(sCCName);
     cc.setRecipientId("2");

     // create a signHere tab somewhere on the document for the signer to sign
     // default unit of measurement is pixels, can be mms, cms, inches also
     SignHere signHere = new SignHere();
     signHere.setDocumentId("1");
     signHere.setPageNumber("1");
     signHere.setRecipientId("1");
     signHere.setXPosition("100");
     signHere.setYPosition("710");

     // Can have multiple tabs, so need to add to envelope as a single element list
     List<SignHere> signHereTabs = new ArrayList<SignHere>();      
     signHereTabs.add(signHere);
     Tabs tabs = new Tabs();
     tabs.setSignHereTabs(signHereTabs);
     signer.setTabs(tabs);

     // add recipients (in this case a single signer) to the envelope
     envDef.setRecipients(new Recipients());
     envDef.getRecipients().setSigners(new ArrayList<Signer>());
     envDef.getRecipients().getSigners().add(signer);
     envDef.getRecipients().getCarbonCopies().add(cc);

     // send the envelope by setting |status| to "sent". To save as a draft set to "created"
     envDef.setStatus("sent");

     // instantiate a new EnvelopesApi object
     EnvelopesApi envelopesApi = new EnvelopesApi();

     // call the createEnvelope() API to send the signature request!
     EnvelopeSummary envelopeSummary = envelopesApi.createEnvelope(accountId, envDef);
     logger.debug("Envelope Id "+ envelopeSummary.getEnvelopeId());

     // Delete the PDF file that Logi generated
     Files.delete(path);

CarbonCopy recipients will receive email only when the envelope gets completed by all the parties based on the recipient's order. 只有当所有各方根据收件人的订单完成信封后,CarbonCopy收件人才会收到电子邮件。 Have a look at the Carbon Copies Recipient description in this link . 在此链接中查看“复本收件人”说明。

Debug the code and make sure whether CarbonCopy values gets added inside the envDef.getRecipients().getCarbonCopies() before it hits the createEnvelope and when the full envelope process gets completed by the signer thereafter a copy will be sent to the carbon copy recipient mail address, to make sure of that sign into the CarbonCopy recipient email address an email must be received along with completed document where you can only view the document.. 调试代码,并确保在遇到createEnvelope之前,envDef.getRecipients()。getCarbonCopies()内是否添加了CarbonCopy值,并且在签名者完成完整信封过程之后,此后会将副本发送到抄送收件人邮件地址,以确保登录到CarbonCopy收件人电子邮件地址中,该电子邮件必须与完整的文档一起收到,您只能在其中查看该文档。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM