Skip to main content

Hi, I would like to set Email Default language to all recipient. I am aware of the option “Custom email and language for each recipient” on the settings, but that is not what I am looking for.

I do not want to enable it because I need to dynamically set the Email subject and text with the Salesforce Apex Toolkit. If I enable this option, I cannot set the subject and text programmtically.

 

I want to set the default language to German (Currently in English).

 

 

How do I achieve this?

 

Hello ​@whaliim 

 

Welcome to the Docusign Community.

 

I’m not sure if my suggestion will solve your problem, but in the bottom right corner of the page you can select the language to be used in the interface as you see in the figure. Also, each user under My preferences can set the default language in the Regional Settings option.

I hope that helps.

 

Best,

Alexandre


Hello ​@whaliim,

 

You can set the default language of an envelope at the APEX or API level, here is a JSON and APEX samples:
{
  "emailSubject": "Test Document",
  "emailBlurb": "Please sign the attached document.",
  "status": "sent",
  "locale": "de",
  ...
}

APEX:
EnvelopeDefinition envDef = new EnvelopeDefinition();
envDef.locale = 'de';

 

Thanks,


Hi ​@Eduardo.Silva 

 

Thank you for answer. I do not use EnvelopeDefinition on my Apex Code. I use dfsle instead. Here are my code:

Id mySourceId = opportunityId_i; // Opportunity ID

// Create an empty envelope.
dfsle.Envelope myEnvelope = dfsle.EnvelopeService.getEmptyEnvelope(
new dfsle.Entity(mySourceId));

// use a Salesforce Contact ID as a Recipient here
Contact myContact = opportunityIdToContactIdMap.get(opportunityId_i);
// Use the Recipient.fromSource method to create the Recipient
dfsle.Recipient myRecipient = dfsle.Recipient.fromSource(
myContact.Name, // Recipient name
myContact.Email, // Recipient email
null, //Optional phone number
'Signer', //Role Name. Specify the exact role name from template
new dfsle.Entity(myContact.Id));

// Add Recipient to the Envelope
myEnvelope = myEnvelope.withRecipients(new List<dfsle.Recipient> { myRecipient });

String templateId = 'myTemplateId';
// myTemplateId contains the DocuSign Id of the DocuSign Template
dfsle.UUID myTemplateId = dfsle.UUID.parse(templateId);

// create a new document for the Envelope
dfsle.Document myDocument = dfsle.Document.fromTemplate(
myTemplateId, // Template Id in dfsle.UUID format
'Opportunity Contract'); // Name of the template

Id myFileId = contentVersionId;
dfsle.Document myPdfDocument = dfsle.DocumentService.getDocuments(ContentVersion.getSObjectType(), new Set<Id> { myFileId }).get(0);
myDocument.withReplacement(myPdfDocument);
/*myDocument.withPdfOptions(new dfsle.Document.PdfOptions(
true, // Whether to transform PDF form fields
1)); // The recipient for which to apply the tags*/

//Add document to the Envelope
myEnvelope = myEnvelope.withDocuments(new List<dfsle.Document> { myDocument });

Account account = opportunityMap.get(opportunityId_i).Account;
myEnvelope = myEnvelope.withEmail(
'My Custom subject',
'My Custom email text'
);

// Send the envelope
myEnvelope = dfsle.EnvelopeService.sendEnvelope(
myEnvelope,
true);

I tried using Recipient Email Settings but it does not work for me either.

How do I resolve this?

 

Kind Regards

WHaliim


Hi ​@Eduardo.Silva 

 

Thanks for your answer. I am not using the envelope definition. I am using dfsle.Envelope and dfsle.Document to create and send an envelope instead. Here are the snippet of my code. I could not show my whole code because it gets deleted by the moderator.

APEX:

dfsle.Envelope myEnvelope = dfsle.EnvelopeService.getEmptyEnvelope( new dfsle.Entity(opportunityId));

dfsle.Document myDocument = dfsle.Document.fromTemplate(myTemplateId, 'Opportunity Document'); 

dfsle.Document myPdfDocument = dfsle.DocumentService.getDocuments(ContentVersion.getSObjectType(), new Set<Id> { contentVersionId}).get(0);
myDocument.withReplacement(myPdfDocument);

myEnvelope = myEnvelope.withDocuments(new List<dfsle.Document> { myDocument });

myEnvelope = dfsle.EnvelopeService.sendEnvelope(myEnvelope, true);

How do I resolve this?

Kind Regards
whaliim


Hi ​@Eduardo.Silva 


Thanks for your answer. I am not using the envelope definition. I am using dfsle.Envelope and dfsle.Document to create and send an envelope instead. And I could not find any documentation about changing the language or locale. 

I also could not attach my  code because it gets deleted by the moderator.

How do I resolve this?

Kind Regards
whaliim