如何在电子邮件中附加云存储中的 pdf 文件

问题描述 投票:0回答:0

我正在使用 firebase 的 firestore-send-email 扩展来发送带有 pdf 附件的电子邮件,但我遇到了意外行为。

唯一一次不工作是当我使用handlebars指定模板文档中pdf的url

path
当url来自云存储。例如:

模板:

subject: "Subject...",
html: "This url is accessible in the body but not in the pdf attachment: {{url}}",
attachments: [
  { 
    filename: {{filename}},
    path: {{url}},
  }
]

案例它确实有效

  • 我直接把url粘贴到模板的附件栏里,如下
attachments: [
 {
  filename: {{filename}},
  path: "https://firebasestorage.googleapis.com/v0/b/..."
 }
]
  • 或者如果我使用 handlebars 的 url 是 除云存储下载 url 之外的任何内容,如下所示:
attachments: [
 {
  filename: testFile.pdf,
  path: {{url}} // this url is: https://www.africau.edu/images/default/sample.pdf
 }
]

是否有一些阻止功能不允许云存储 url 专门作为电子邮件中的附件?

firebase nodemailer firebase-extensions
© www.soinside.com 2019 - 2024. All rights reserved.