繁体   English   中英

Prestashop从html2pdf发送邮件附件pdf

[英]Prestashop send mail attachment pdf from html2pdf

一切都在标题中,但更确切地说:

我对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_
    );

(通过html2pdf生成$voucher voucher)

邮件已发送,但遗憾的是没有附件。 但是,如果我将输出选项从E更改为I ,应该将pdf直接发送到用户浏览器,它就像魅力...

我真的不明白我错在哪里,如果......

尝试使用Tools :: file_get_contents('useless.pdf')而不是$ voucher-> output,并检查是否在正确的位置发送此数据

暂无
暂无

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

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