native-ios-sdk icon indicating copy to clipboard operation
native-ios-sdk copied to clipboard

templatesManager?.presentSendTemplateControllerWithTemplate() throwing error in V3.4.0

Open JacobVnu opened this issue 1 year ago • 10 comments

In Docusign 3.0.3 version app working perfectly. Recently I have updated the Docusign framework to V3.4.0 using cocoapods. Also I have changed the syntax for DSMManager.login method. But in the latest version 3.4.0 the app throwing the error while calling the function,

templatesManager?.presentSendTemplateControllerWithTemplate()

Error getting: Template has invalid recipient(s) associated with roleName: Assistant. Current Setup config for DSM_SETUP_RECIPIENT_DEFAULTS_CASE_INSENSITIVELY_MATCH_ROLE_NAME : false

And I checked in Docusign template and verify the role name. It's same as Assistant. There is no case mismatch.

Here is my configuration code of Docusign,

    let configuration: [String: Any] = [DSM_SETUP_OFFLINE_SIGNING_USE_PLACEHOLDER_TAB_VALUE: false, DSM_SETUP_DISABLE_CONTACTS_USAGE_KEY: false]
    DSMManager.setup(withConfiguration: configuration)
    DocuSignSyncEnvelopesWorker.shared.configure()

JacobVnu avatar Jan 08 '25 08:01 JacobVnu

Hello Can you share more details about the account and template you are using so we can better investigate this issue? you can use our feedback email [email protected]

mmohareb avatar Jan 21 '25 17:01 mmohareb

Closing ticket due to inactivity

mmohareb avatar Mar 06 '25 17:03 mmohareb

I Updated the Docusign to latest version 4.0.1, using SPM. Still is gettin the same error.

JacobVnu avatar Aug 06 '25 06:08 JacobVnu

Hi @JacobVnu - In order to assist you with this issue, could you please download and share the template on following email:

Can you share more details about the account and template you are using so we can better investigate this issue? you can use our feedback email [email protected]

Thanks.

ashokds avatar Aug 11 '25 17:08 ashokds

Hi @JacobVnu -- Did you get a chance to download the template JSON and send it over?

Go to the Templates page. Locate the template that you want to download by searching, filtering, or simply scanning the Templates list. Click the template actions menu and select Download. A .ZIP file containing a copy of the template in JSON format is saved to your Downloads folder. The file name is "DocuSignTemplates_[date_and_time].zip".

More details here - download templates

ashokds avatar Aug 26 '25 20:08 ashokds

Hi @ashok

We have shared the template to the mentioned email id. Please have a look.

Thanks.

JacobVnu avatar Sep 26 '25 06:09 JacobVnu

Hi @JacobVnu :

Thanks for sending the template over. I tried it with v3.4.0 and v4.0.0 and unable to reproduce Template has invalid recipient(s) associated with roleName: Assistant. error on my end. Template is configured correctly to be used with SDK.

It seems that the issue might be with the RecipientsDefaults and that is passed to the SDK as part of the EnvelopeDefaults -- more details on it here.

Are you using it? If so, could you also please share the code snippet which is being used to configure the envelope and recipients.

Thanks

ashok-meena-engcp avatar Oct 13 '25 17:10 ashok-meena-engcp

Hi @ashok-meena-engcp

Thanks for verifying the Template. I have shared the requested details into the mailId: [email protected]. Please have a look into it. If any other details required, feel free to ask.

Thanks

JacobVnu avatar Oct 14 '25 06:10 JacobVnu

Hi @JacobVnu --

It's possible that you are passing the nil for envelopeDefaults.recipientDefaults Is that the case? As in the code snippet shared over email details on how the recipientData is configured is missing.

// Call to `displayTemplateForSignature` with `recipientData` and `tabData`
func displayTemplateForSignature(..., tabData:
[String: String], recipientData: [DSMRecipientDefault], ....) {

... 
...

let envelopeDefaults = DSMEnvelopeDefaults()
// Assignment of `recipientData` or `nil`
envelopeDefaults.recipientDefaults = recipientData.count > 0 ? recipientData : nil
envelopeDefaults.tabValueDefaults = tabData
envelopeDefaults.customFields = customFields

We use the TGK Sample app to help developers with the iOS/Droid SDK integration. Sharing the following code snippet from TGK Financial Sample app -- This is how two IPS could be configured when using recipientDefaults.

let email: String = Keychain.value(forKey: KeychainKeys.accountEmail)!
            let username: String = Keychain.value(forKey: KeychainKeys.signerName)!
            
            let envelopeDefaults = DSMEnvelopeDefaults()
            envelopeDefaults.emailBlurb = "Please sign this envelope."
            envelopeDefaults.emailSubject = "Please sign this envelope."
            
            
            let recipientDefault = DSMRecipientDefault()
            recipientDefault.recipientType = .inPersonSigner
            recipientDefault.recipientSelectorType = .recipientRoleName
            recipientDefault.recipientRoleName = "Assistent_Replace_RoleName"
            recipientDefault.inPersonSignerName = "Signer Name"
            recipientDefault.recipientName = username
            recipientDefault.recipientEmail = email
            
            let recipientDefault2 = DSMRecipientDefault()
            recipientDefault2.recipientType = .inPersonSigner
            recipientDefault2.recipientSelectorType = .recipientRoleName
            recipientDefault2.recipientRoleName = "Tenet_Replace_RoleName"
            recipientDefault2.inPersonSignerName = "Signer Name2"
            recipientDefault2.recipientName = username
            recipientDefault2.recipientEmail = email
            
            envelopeDefaults.recipientDefaults = [recipientDefault, recipientDefault2]

Thanks for sharing the details.

ashok-meena-engcp avatar Oct 15 '25 17:10 ashok-meena-engcp

Hi Ashok,

I checked the code and we are passing the value for envelopeDefaults.recipientDefaults. It's not nil. Also attached the code for the same in the mail. could you please check it.

Thanks, Jacob

JacobVnu avatar Oct 21 '25 09:10 JacobVnu

Hi @ashok-meena-engcp

I have found the issue. While passing the DSMRecipientDefault() value, one of the recipient Assistant the value of removeRecipient was setting to true. In that case I was getting the error mentioned in the ticket,

Error getting: Template has invalid recipient(s) associated with roleName: Assistant. Current Setup config for DSM_SETUP_RECIPIENT_DEFAULTS_CASE_INSENSITIVELY_MATCH_ROLE_NAME : false

But this same DSMRecipientDefault() I was passing in the Docusign version, V3.4.0. But it was working without any error.

Could you please tell me why it's happening?

Thanks

JacobVnu avatar Nov 12 '25 10:11 JacobVnu