0

我正在使用 Kohana PDF 查看器模块(DOMPDF) 从 HTML 页面动态创建 PDF 文件。

我可以使用 Kohanasend_file查看或下载 PDF:

// Load a view using the PDF extension
$pdf = View_PDF::factory('Print/Summary');

// Use the PDF as the request response
$response = new Response();
$response->body($pdf);

$filename = 'myfile.pdf';
$response->send_file(TRUE, $filename, array('inline' => TRUE));

我想将此 PDF 附加到电子邮件并发送,但我不确定获取此 PDF 的最佳方法是什么,因为我通常使用上传的文件而不是服务器生成的文件?

感谢您对此的帮助。

4

1 回答 1

1

您可以使用 swiftmailer 执行此操作:http ://swiftmailer.org/docs/messages.html#attaching-dynamic-content

我建议使用 Shadowhand 的电子邮件模块,它本质上是 swiftmailer 的包装器:https ://github.com/shadowhand/email

于 2012-11-28T09:22:02.450 回答