英文:
Docusign: Dynamic Fields not replaced in the document
问题
{
"emailSubject": "测试邮件",
"templateId": "xxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"templateRoles": [
{
"email": "xxxe@gmail.com",
"name": "xxxxx",
"roleName": "签署者",
"tabs": {
"textTabs": [
{
"tabLabel": "姓名",
"anchorString": "{{Name}}",
"value": "约翰·多"
},
{
"tabLabel": "面试日期",
"anchorString": "{{InterviewDate}}",
"value": "2023年06月15日"
},
{
"tabLabel": "面试时间",
"anchorString": "{{InterviewTime}}",
"value": "上午10:00"
},
{
"tabLabel": "面试地点",
"anchorString": "{{InterviewLocation}}",
"value": "123 Main St"
}
]
}
}
],
"status": "已发送"
}
我正在使用DocuSign发送候选人的邮件。使用模板文档进行发送。
但是,在生成的API响应中,动态值没有被替换,而是重叠在一起。
<details>
<summary>英文:</summary>
`{
"emailSubject": "Test Mail",
"templateId": "xxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"templateRoles": [
{
"email": "xxxe@gmail.com",
"name": "xxxxx",
"roleName": "Signer",
"tabs": {
"textTabs": [
{
"tabLabel": "Name",
"anchorString": "{{Name}}",
"value": "John Doe"
},
{
"tabLabel": "InterviewDate",
"anchorString": "{{InterviewDate}}",
"value": "2023-06-15"
},
{
"tabLabel": "InterviewTime",
"anchorString": "{{InterviewTime}}",
"value": "10:00 AM"
},
{
"tabLabel": "InterviewLocation",
"anchorString": "{{InterviewLocation}}",
"value": "123 Main St"
}
]
}
}
],
"status": "sent"
}`
[Sample Doc File][1]
I am using docusign to send candidate a mail. The send with the template document.
But when make the api response the dynamic value's are not replaced, it's overlapped.
[see attached image (output)][2]
[1]: https://i.stack.imgur.com/2uakr.png
[2]: https://i.stack.imgur.com/Hnnzt.png
</details>
# 答案1
**得分**: 0
你在这里混淆了两个事情。
如果你正在尝试使用[文档生成][1],像这样的{{字段}}应该在一个Word文档(.docx)中,并添加到一个模板中。然后,您可以进行不同的API调用来更新从此模板生成的信封中的值。在[代码示例][2]中查看更多详细信息。
现在,另一种选项是你只想要文本标签并设置它们的值。那是不同的。在这种情况下,你不使用文档生成,根本不使用双花括号,你可以使用任何你想要的文档,并进行完全不同的API调用来更新标签的值。
如果这是你想要做的事情 - 请遵循[这个代码示例][3]。
[1]: https://www.youtube.com/watch?v=O3IrSP2pkjM
[2]: https://developers.docusign.com/docs/esign-rest-api/how-to/request-signature-email-document-generation/
[3]: https://developers.docusign.com/docs/esign-rest-api/how-to/set-template-tab-values/
<details>
<summary>英文:</summary>
You are confusing two things here.
If you are trying to use [document generation][1], the {{fields}} like this should be in a Word document (.docx) and then added to a template. Then you make a different API call to update their values in the envelope generated from this template. See more details in [the code example][2]
Now, another option is that you just want to have text tabs and set their value. That's different. In that case you don't use document generation, you don't use double curly brackets at all, you can use any document(s) you want and you make an entirely different API call to update tabs' values.
If that's what you want to do - follow [this code exmaple][3].
[1]: https://www.youtube.com/watch?v=O3IrSP2pkjM
[2]: https://developers.docusign.com/docs/esign-rest-api/how-to/request-signature-email-document-generation/
[3]: https://developers.docusign.com/docs/esign-rest-api/how-to/set-template-tab-values/
</details>
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论