简体   繁体   English

如何发送附加到签名请求的文件 email

[英]How to send a file attached to the signature request email

I'm using the PHP SDK to integrate DocuSign eSign REST API into a Laravel application.我正在使用 PHP SDK 将 DocuSign eSign REST API 集成到 Laravel 应用程序中。 We have been asked to attach a couple of PDF files to every signature request email, but I don't know if this is even possible.我们被要求将几个 PDF 文件附加到每个签名请求 email,但我不知道这是否可能。

I thought that the EnvelopeAttachments resource would be a way to go, but signers do not receive any attachment so far and here it is said that such attachments are not visible for them.我认为EnvelopeAttachments 资源将是通往 go 的一种方式,但到目前为止,签名者没有收到任何附件, 这里据说这样的附件对他们来说是不可见的。

Here there is the SDK code I am using:这是我正在使用的 SDK 代码:

$attachments = [
            new Attachment([
                'access_control' => 'sender',
                'attachment_id' => '1',
                'attachment_type' => '.pdf',
                'data' => base64_encode($this->getPdf($document, $signers)),
                'label' => 'attachment 1',
                'name' => 'attachment 1',
                'remote_url' => 'attachment 1',
            ]),
        ];
        $envelope_definition = new EnvelopeDefinition([
            'composite_templates' => $composite_templates,
            'email_subject' => "Firmar $documentTypeSp",
            // 'email_blurb' => "Se solicita su firma para el contrato $document->name",
            'status' => "sent",
            'attachments' => $attachments,
        ]);
        $envelope_definition->setEnvelopeAttachments($attachments);
        return $envelope_definition;

You cannot attach a file to this email that is auto-generated by the system.您不能将系统自动生成的文件附加到此 email。 The envelope attachment shows in the envelope, it is not attached to the email.信封附件显示在信封里,不是email的附件。

While I don't recommend it, your only option is to send emails yourself, with links going to your own webserver, where you generate embedded signing URLs on the fly and redirect the users.虽然我不推荐这样做,但您唯一的选择是自己发送电子邮件,链接转到您自己的网络服务器,您可以在其中动态生成嵌入式签名 URL 并重定向用户。

I would suggest you consider an alternative to having the attachment in the email. Like having a link in the email that goes to some sort of cloud storage or to your own server.我建议您考虑在 email 中添加附件的替代方法。例如在 email 中添加指向某种云存储或您自己的服务器的链接。

The EnvelopeAttachments resource is used to attach a document to an envelope. EnvelopeAttachments 资源用于将文档附加到信封。 According to the API documentation, attachments are not visible to signers.根据 API 文档,签名者看不到附件。 So, it appears that it is not possible to attach a file to the signature request email.因此,似乎无法将文件附加到签名请求 email。

One alternative approach to include the PDF files in the email body is to embed them as inline images.将 PDF 文件包含在 email 正文中的另一种方法是将它们嵌入为内联图像。 You can convert the PDF to an image format, such as PNG or JPG, and then embed the image into the HTML email body using the <img> tag.您可以将 PDF 转换为图像格式,例如 PNG 或 JPG,然后使用<img>标签将图像嵌入到 HTML email 正文中。 The recipient can then view the PDF document directly in the email.然后收件人可以直接在email查看PDF文档。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM