首页 > 解决方案 > 如何从现有模板进行大量发送

问题描述

我已经完成了一个表格,所以我想用它进行批量发送,我已经创建了批量发送列表,但是在此处的示例代码中:https ://developers.docusign.com/esign-rest-api/ code-examples/bulk-sending-envelopes看起来它正在创建一个新文档 如何将现有文档添加到此批量发送?

标签: pythondocusignapi

解决方案


您需要修改批量发送代码示例的第 4 步中使用的 make_envelope() 方法,如下所示:

def make_envelope(cls, args):
        """
        Creates envelope
        args -- parameters for the envelope:
        signer_email, signer_name, signer_client_id
        returns an envelope definition
        """

        # create the envelope definition
        envelope_definition = EnvelopeDefinition(
            status="sent",  # requests that the envelope be created and sent.
            template_id=args["template_id"]
        )
        # Create template role elements to connect the signer and cc recipients
        # to the template
        signer = TemplateRole(
            email=args["signer_email"],
            name=args["signer_name"],
            role_name="signer"
        )
        # Create a cc template role.
        cc = TemplateRole(
            email=args["cc_email"],
            name=args["cc_name"],
            role_name="cc"
        )

        # Add the TemplateRole objects to the envelope object
        envelope_definition.template_roles = [signer, cc]
        return envelope_definition

请注意,我的模板有两个收件人(抄送和签名者)。您引用的模板可能会有所不同。这是使用模板创建信封 的完整来源


推荐阅读