0
votes

So I am building a crm/docusign/crm integration. The flow is as follows:

  1. Salesperson clicks a button that takes them to a page on my server(scala play framework instance) that generates and sends the envelope for the document that the user can sign.
  2. Document is sent to user for signing.
  3. Once signed, Write the data back to the crm to each contact/lead/company, depending on field names mapped from docusign to the crm.

This is all working fine and dandy. Problem is, if there are more than 1 contact, they should all get the SAME docusign document and all be signers on it. I am not 100% sure this is even possible, or really why 2 of the same documents is an issue for the client, but it appears to be. The funky part about all of this is I CAN add more than 1 signer at the moment to the same envelope id, but the document is only editable by the first contact on the lead. Everyone else that gets it can't edit it. Once marked finished by the only person that can sign it, it just has their information on it for the other signers and is in read only mode still.

My question is is there any way this is possible? I am assuming that it isn't since each envelope id can really only relate to a single signer. It doesn't even make sense to me how a second signer could sign the same document with the same envelope id and put in different data and it maintain the integrity of both signers since envelope id seems to be a sort of session for the document. If anyone has any experience with the docusign API, I'd really appreciate some insight on this!

Code I'm using:

private def makeEnvelope(contacts: List[Contact], accountInfo: AccountInfo, leadId:Int, whichForm:FORMTYPE) = {

val env = new EnvelopeDefinition

val eventNotification = new EventNotification
  
eventNotification.setUrl(callbackURL) // fake var name for privacy
env.setTemplateId(templateId)



eventNotification.setRequireAcknowledgment("true")
eventNotification.setIncludeDocuments("true")
eventNotification.setLoggingEnabled("true")
var envelopeEvents : List[EnvelopeEvent]= List.empty[EnvelopeEvent]
val envelopeEvent = new EnvelopeEvent
envelopeEvent.setEnvelopeEventStatusCode("completed")
envelopeEvent.setIncludeDocuments("true")
envelopeEvents = envelopeEvent :: envelopeEvents
eventNotification.setEnvelopeEvents(envelopeEvents.asJava)
env.setEventNotification(eventNotification)

var signerList = List[TemplateRole]()
for(contact <- contacts) {

  val signer1 = new TemplateRole
  val signEmail = contact.email

  signer1.setEmail(signEmail)
  signer1.setName(contact.fullName)


  signer1.setRoleName("Signatory")


  val showAddress: Boolean = contacts.length == 1

  // tabs is some data from crm to map to prepopulate docusign when user signs form
  val tabs = populateFormData(accountInfo, contact, whichForm, showAddress)

  signer1.setTabs(tabs)
  signerList = signer1 :: signerList



}

env.setTemplateRoles(signerList.asJava)


env.setStatus("sent")

env

}

1
Can you share your code? What you want is possible, but you're doing something wrong, I just can't tell yet what it isInbar Gazit
@InbarGazit Code added to original post. Once this function is called, it calls the envelopeApi.createEnvelope Which sends it to all the signers, but only 1 can edit. very odd.jeffro25
you are using a template, I wonder if the template is set correctly. If you use this template from the web app (not from this code) it works correctly?Inbar Gazit
@InbarGazit so it appears as though it does not work via the web app either. Perhaps templates aren't the way to go for this task. you are very knowledgeable in the docusign api. what should have been used here to accomplish this?jeffro25
templates may work,. but it appears you didn't set it correctly. Did you place signing elements for all signers? Note you have to user the drop-down on the top-left corner to change signers and then place them, they'll appear in different colors (we call this the 'tagger')Inbar Gazit

1 Answers

0
votes

If you want a dynamic number of signers for the envelopes (envelope 1 has one signer, envelope 2 has two signers) then do not use a template.

Instead, create the entire envelope object on the fly so it will fit the needs of each envelope. Eg, the envelope object for envelope 2 will include two signer recipients with each having (at least) a sign_here tab.

If you don't know how to create an envelope object that includes two signer recipient objects, ask a new stackOverflow question.