Error when emailing invoice

When I am sending out quote to my clients. I get an error message. I am hoping someone can help me. I’ve followed the instruction on here: https://community2.invoiceplane.com/t/topic/3515 , to try to resolve error message but still got the same error. Please take a look at the error message below. If you can help, i would really appreciate it.

A PHP Error was encountered

Severity: Warning

Message: unlink(/home/invoicebeachlife/public_html/uploads/temp/mpdf): Is a directory

Filename: helpers/mpdf_helper.php

Line Number: 117

Backtrace:

File: /home/invoicebeachlife/public_html/application/helpers/mpdf_helper.php
Line: 117
Function: unlink

File: /home/invoicebeachlife/public_html/application/helpers/pdf_helper.php
Line: 254
Function: pdf_create

File: /home/invoicebeachlife/public_html/application/helpers/mailer_helper.php
Line: 92
Function: generate_quote_pdf

File: /home/invoicebeachlife/public_html/application/modules/mailer/controllers/Mailer.php
Line: 208
Function: email_quote

File: /home/invoicebeachlife/public_html/index.php
Line: 327
Function: require_once

A PHP Error was encountered

Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at /home/invoicebeachlife/public_html/vendor/codeigniter/framework/system/core/Exceptions.php:271)

Filename: helpers/url_helper.php

Line Number: 564

Backtrace:

File: /home/invoicebeachlife/public_html/application/modules/mailer/controllers/Mailer.php
Line: 215
Function: redirect

File: /home/invoicebeachlife/public_html/index.php
Line: 327
Function: require_once

Can you go here (using your FTP client) and tell us your pdf files names: YOUR_SITE/uploads/archive

There is only two file i see in there… one is a .htaccess file and the other one is a .gitignore

Hope that clarify it somewhat?

chmod 777 the folder /upload/ and see what happens.

What is your invoice’s guest URL? (It should be something like /guest/view/invoice/x317FgzjBiPR8EI)

I’ve changed the /upload folder permissions. and tested… didn’t resolve the issue

here is the guest url

/index.php/guest/view/quote/HJBUrhaunTkejbW

I notice something really weird. The pdf invoice/quote file that i generated is placed in the temp folder and not in the /temp/mpdf folder

does that have anything to do with it?

BTW… thanks MUSA for trying to help…

Does anyone have a possible solution to this problem? I am still stuck… Thanks

Related:
https://community2.invoiceplane.com/t/topic/4666
https://community2.invoiceplane.com/t/topic/4416

Are you customising your e-mail template with HTML? Does it include <head> statements? Have you copy/pasted the “HTML” source from a rich HTML editor and added Invoiceplane tags?

If so, try creating a non-HTML template to test, and slowly add in <body> type elements if it works. Don’t include any <head> or <body> statements (or their associated closing tags). Start simple…

Everything was standard. i didn’t add anything or create anything extra. it was straight out of the box install. Just can’t figure out what is causing it to occur.

Can you go to that page and download your pdf from there?

it gives me an error when i go to it.

An Error Was Encountered

Unable to load the requested file: quote_templates/public/.php

This error occurs if you set a pdf template in the past and it’s not available anymore, likely after a major update for InvoicePlane.
Please check your settings and set all PDF templates correctly.

go to /settings, then click on tab Quotes, scroll down and make sure you selected a PDF template.
If you can’t select any PDF template, it means you’re missing a file within folder /application/views/quote_templates/pdf

@musa, Should this not be looking for **/template_name.php"?

@beachlifemarketing , Do you receive any errors on page two of https://yourdomain/path/index.php/setup/prerequisites/ ? (you may need to re-enable access to setup within the ipconfig.php file - DISABLE_SETUP=true. Do you know much about your hosting environment?

Sorry?

The InvoicePlane app scans the /pdf directory for .php files and prints them in a select box on the settings page.
Either the template (php file) was deleted, which I very doubt, either OP played with the invoices templates settings and set the default template to “nothing” instead of “InvoicePlane” or “InvoicePlane - Paid” or “InvoicePlane - Overdue” or whatever it’s called I can’t remember.
Hence the empty setting value in OP’s db.
You can easily reproduce OP’s bug switching the default invoice PDF template to “none” then try to download it from the guest page.

Yes, that’s what I was getting at. I missed your bit saying, essentially, the same thing. :slight_smile:

New Invoice Plane user here! Love it. Successfully installed it yesterday (after struggling with some SMTP settings due to G-Suite/2-factor authentication/App-specific password).

I too ran into similar issues as the first one, but mine are when I email a Quote. But the error messages I receive are almost identical to the first post in this thread. Specifically:

A PHP Error was encountered

Severity: Warning

Message: unlink(/example.com/uploads/temp/mpdf): Is a directory

Filename: helpers/mpdf_helper.php

Line Number: 117

Backtrace:

File: /example.com/application/helpers/mpdf_helper.php
Line: 117
Function: unlink

File: /example.com/application/helpers/pdf_helper.php
Line: 254
Function: pdf_create

File: /example.com/application/helpers/mailer_helper.php
Line: 92
Function: generate_quote_pdf

File: /example.com/application/modules/mailer/controllers/Mailer.php
Line: 208
Function: email_quote

File: /example.com/index.php
Line: 327
Function: require_once

A PHP Error was encountered

Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at /example.com/vendor/codeigniter/framework/system/core/Exceptions.php:271)

Filename: helpers/url_helper.php

Line Number: 564

Backtrace:

File: /example.com/application/modules/mailer/controllers/Mailer.php
Line: 213
Function: redirect

File: /example.com/index.php
Line: 327
Function: require_once

Any thoughts? I haven’t done any modifications to templates or anything. Note: the emails do indeed send.

Thanks!

I now added an issue for that, seems to be a more common problem.

https://development.invoiceplane.com/browse/IP-571