I needed to send an email with a PDF attached. All of this was pretty simple to do with the SnappyBundle and Swift Mailer. Whenever a call is made to ../document_name/{id}/mail
a pdf is generated and the e-mail is sent.
To tried to make the user exp a little better I decided to implement the Messenger component with RabbitMQ to queue this action. But things kinda broke for Snappy at this point. This is the error I'm getting:
The exit status code '1' says something went wrong:
stderr: "The system cannot find the path specified.
"
stdout: ""
command: ..\vendor\bin\wkhtmltopdf.exe.bat --dpi "300" --image-quality 100 --page-size "A4" --footer-html "C:\Users\user\AppData\Local\Temp\knp_snappy5c8bfb5887e059.82496553.html" --header-html "C:
\Users\user\AppData\Local\Temp\knp_snappy5c8bfb588a7c92.82567496.html" "C:\Users\user\AppData\Local\Temp\knp_snappy5c8bfb588659c2.24298174.html" "C:\Users\user\AppData\Local\Temp\knp_snappy5c8bfb
5887d116.94779844.pdf".
- The service that generates the pdf and then sends it works just fine whenever is not been used by the
messenger:consume_messages
. - In order to make Swift Mailer send the email as soon as I did
$msg->send();
and to not spool it in memory I commented out the# spool: { type: 'memory' }
onswiftmailer.yml
as otherwise the email wouldn't be sent whenmessenger:consume_messages
ran de service.