Php Prestashop从html2pdf发送邮件附件pdf
所有内容都在标题中,但更准确地说: 我对Cart.php进行了重写,在这个函数中,我想发送一封带有pdf格式的邮件作为附件Php Prestashop从html2pdf发送邮件附件pdf,php,email,pdf,prestashop,html2pdf,Php,Email,Pdf,Prestashop,Html2pdf,所有内容都在标题中,但更准确地说: 我对Cart.php进行了重写,在这个函数中,我想发送一封带有pdf格式的邮件作为附件 $file_attachement['content'] = $voucher->output("useless.pdf", 'E'); $file_attachement['name'] = 'Voucher.pdf'; $file_attachement['mime'] = 'application/pdf'; Mail::Sen
$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_
);
(其中,$凭证
通过html2pdf生成)
邮件已发送,但不幸的是没有附件。但是,如果我将输出选项从E
更改为I
,应该将pdf直接发送到用户浏览器,它就像一个魔咒
我真的不明白我错在哪里,如果…尝试使用工具::file\u get\u contents('untible.pdf')而不是$voucher->output,并检查您是否将此数据发送到正确的位置您确定$file\u attachment应该是第七个参数吗?您是对的。。。不知道为什么我把它放在第七,应该在第九。。。我更改了它,回来后我非常确定它不会工作,
无用的.pdf
不存在,如果输出的第二个参数是E
则忽略第一个参数。该文件从未创建过,我只要求输出
以mime类型字符串呈现pdf。好的,那么。你能说得具体一点吗?美元凭证对象是什么?您是在重写中创建自己的方法还是重写现有的方法?对不起,我忘了精确定义它。后期编辑;)