它创建pdf并通过邮件发送该pdf。现在我想要那个 pdf 共享或发送到 whatsapp。
如果可能的话,比直接共享选项更明智地在某处创建 pdf 存储并从那里共享。
**public function index() {
$data["email"] = "to@gmail.com";
$data["title"] = "From: from@gmail.com";
$data["body"] = "This is Demo";
$pdf = PDF::loadView('emails.myTestMail', $data);
// return "https://wa.me/{whatsapp_no}?attachments=".$pdf->output();
Mail::send('emails.myTestMail', $data, function($message)use($data, $pdf) {
$message->to($data["email"], $data["email"])
->subject($data["title"])
->attachData($pdf->output(), "text.pdf");
});
dd('Mail sent successfully');
}**