Attach PDFs to client mail

Is it possible to generate and attach a PDF to the mail the client receives…?

You should just need to enable ‘Attach Invoice’ on /settings/email_settings

I have that option enabled.

Do you think I need Phantom installed also then…?

It should work with https://phantomjscloud.com/

There’s more info here: http://docs.invoiceninja.com/en/latest/configure.html#phantomjs

I’d also suggest checking for any errors in storage/logs/laravel-error.log

Installed Phantom and hey presto !

Awesome, great to hear!

One more question regarding the attachments. Do you need a paid license for self hosted invoiceninja to get the attachments working?
For some reason the attachment is not working for me?

Are there any relevant errors in storage/logs/laravel-error.log

yes but only 2 lines; (I changed domain and username)

`[2017-05-07 18:27:16] production.ERROR: Local PhantomJS Error: 0 - https://#MYDOMAIN#/view/ndyduy1cl6cjxvvb1tfb89srwuaw0bmr?phantomjs=true&phantomjs_secret=lyykv4yjpxmav8tjkjry01vhb1klqwm3 {“context”:“PHP”,“user_id”:1,“account_id”:1,“user_name”:"#MYUSERNAME#",“method”:“PUT”,“url”:“https://#MYDOMAIN#/invoices/5”,“previous”:“https://#MYDOMAIN#/invoices/5/edit”,“user_agent”:“Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36”,“ip”:“192.168.2.157”,“count”:3} []
[2017-05-07 18:27:16] production.ERROR: PhantomJS - Invalid response: {“context”:“PHP”,“user_id”:1,“account_id”:1,“user_name”:"#MYUSERNAME#",“method”:“PUT”,“url”:“https://#MYDOMAIN#/invoices/5”,“previous”:“https://#MYDOMAIN#/invoices/5/edit”,“user_agent”:“Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36”,“ip”:“192.168.2.157”,“count”:4} []

Please check that you’re using phantomjs v2.1.1.

Got it installed according to the manual from I.N.

phantomjs --version
2.1.1

Can you check which phantomjs matches the value for PHANTOMJS_BIN_PATH

You are fast, thnx :wink:

which phantomjs
/usr/local/bin/phantomjs

It’s a match: PHANTOMJS_BIN_PATH=/usr/local/bin/phantomjs

You can try manually running phantomjs using this script, you’ll need to replace YOUR_LINK_HERE with https://#MYDOMAIN#/view/ndyduy1cl6cjxvvb1tfb89srwuaw0bmr?phantomjs=true&phantomjs_secret=lyykv4yjpxmav8tjkjry01vhb1klqwm3

https://raw.githubusercontent.com/invoiceninja/invoiceninja/develop/resources/test.pjs

Copied it and performed a test;

 <strong>phantomjs test.yml</strong>
\n{
    "contentType": null,
    "headers": [],
    "id": 1,
    "redirectURL": null,
    "stage": "end",
    "status": null,
    "statusText": null,
    "time": "2017-05-15T20:06:32.677Z",
    "url": "https://#MY_DOMAIN#/view/ndyduy1cl6cjxvvb1tfb89srwuaw0bmr?phantomjs=true&phantomjs_secret=lyykv4yjpxmav8tjkjry01vhb1klqwm3",
    "console": []

Maybe the info here will help:

https://github.com/jonnnnyw/php-phantomjs/issues/86