【发布时间】:2018-06-20 13:19:03
【问题描述】:
一切都在标题中,但更准确地说:
我在一个函数中覆盖了 Cart.php,我想发送一封带有生成为附件的 pdf 的邮件。
$file_attachement['content'] = $voucher->output("useless.pdf", 'E');
$file_attachement['name'] = 'Voucher.pdf';
$file_attachement['mime'] = 'application/pdf';
Mail::Send(
(int)Context::getContext()->language->id,
'voucherSend',
"blabla.",
array(),
$customer->email,
$customer->firstname.' '.$customer->lastname,
$file_attachement,
null, _PS_MAIL_DIR_
);
(其中$voucher是通过html2pdf生成的)
邮件已发送,但遗憾的是没有附件。但是,如果我将输出选项从 E 更改为 I,应该将 pdf 直接发送到用户浏览器,它就像一个魅力......
我真的不明白我哪里错了,如果……
【问题讨论】:
-
你确定$file_attachment应该是第七个参数吗?
-
你是对的...不要不知道为什么我把它放在第 7 位,应该在第 9 位...我改变它,我回来了
标签: php email pdf prestashop html2pdf