3

I'd like to CC someone with the DocuSign PHP API. This is the code I have at the moment.

$all_cc = [];
$cc = new \DocuSign\eSign\Model\CarbonCopy();
$cc->setEmail("email@domain.com");
$cc->setName("Bob Smith");
$cc->setNote("This is a note for the CC guy");
$all_cc[] = $cc;

Then I try to feed the above into the setCarbonCopies method of the recipients object.

$recipients = new DocuSign\eSign\Model\Recipients();
$recipients->setSigners($all_signers);
$recipients->setCarbonCopies($all_cc);

I've also tried passing $cc directly into setCarbonCopies but that also doesn't work.

Where am I going wrong?

UPDATE:

So I got it to work by adding this line:

$cc->setRecipientId("XXX");

I've notice though that the email is only CC'd to the user AFTER the document has been signed. I would like to CC the user before it is signed. Not sure if that's possible.

MemUya
  • 347
  • 3
  • 13
  • What is the error or undesired behavior that you're seeing? – Vince Horst Oct 27 '16 at 23:04
  • The exception that is caught comes back with this message: [400] Error connecting to the API (https://demo.docusign.net/restapi/v2/accounts/XXXXXXX/envelopes). This is thrown when trying to create the envelope. The error only occurs when I starting messing with the CC stuff. – MemUya Oct 27 '16 at 23:12
  • is the recipientId you set unique? (not the same as the signer)? – Andrew Oct 31 '16 at 07:03
  • That's correct. The recipient ID is unique. – MemUya Nov 01 '16 at 04:25
  • If you care to do so, you should answer your own question by posting the full solution as an answer, then marking it as accepted a couple days later. That way this perfectly functional solution won't look like an unanswered abandoned question to the SO community. It worked for me. – Kai Qing Aug 17 '17 at 16:41

0 Answers0