Jump to content

Remove PDF Invoice Attachment from Payment Confirmation


Legotan

Recommended Posts

Hi Alex,

18 hours ago, Legotan said:

I've got one question: Is it somehow possible to remove the Invoice PDF from the Payment Confirmation Email?

not easily.

if you didn't want to send any PDF invoices (both unpaid and paid), then you could simply disable the feature.

https://docs.whmcs.com/Invoice_Tab#Enable_PDF_Invoices

Quote

When enabled, a copy of the invoice will be attached to invoice notification emails in pdf format.

but to enable in one, but not the other would be difficult.

you could certainly edit the invoicepdf.tpl template and make it blank for paid invoices - you'd just need to wrap it in an if statement...

<?php
if ($status != 'Paid') {

*** rest of invoicepdf.tpl

}

so the PDF invoice attachment will be blank for Paid invoices, all other statuses would be as normal.

invoicepdf.tpl

Link to comment
Share on other sites

Thank you Brian! However this still wouldnt be a good user experience..

And what would be the complicated way? I mean I cant be the only one wanting to disable pdf invoice on the payment confirmation email? :D

Greetings,

 

Alex

Link to comment
Share on other sites

Hi Alex,

18 hours ago, Legotan said:

However this still wouldn't be a good user experience..

welcome to using WHMCS.:smile2:

18 hours ago, Legotan said:

I mean I cant be the only one wanting to disable pdf invoice on the payment confirmation email?

I had a quick look in the feature requests site and I couldn't see anyone else asking for this.... nor can I recall another post from the last 5 years asking either... so if not unique, it's very rare to be asked to remove an attachment from one email, but leave it in another.... certainly to send an unpaid pdf invoice attachment, but then not want to send a paid pdf invoice attachment is unusual.

18 hours ago, Legotan said:

And what would be the complicated way?

to return to the disabling the attachment in the email method I mentioned earlier, that wouldn't stop the client from logging into the client area and downloading a PDF invoice if they want to.... it just prevents the attachments being sent in the emails.... and you can't disable these PDF attachments on a per-template basis... they are either sent with all invoice emails, or none... now you could submit a feature request about that, but it would take years for it to reach the completion - if at all.

i'm not even sure there is a 'simple' complicated way... it's not simple to strip the attachment off the email before it's sent; you couldn't really disable the template and use another one - because it would have to be an invoice type template in order to have access to the invoice variables, and that would automatically have the attachment added (so you've gained nothing)... I suppose you could use another email template type and then use hooks to pass the invoice variables to it... that would be complicated and long-winded, but possible.

i'm unsure why you don't want to send a paid PDF invoice/receipt, but the simpler solutions would be to either disable the attachment feature and get the clients to download the invoice themselves, or if you have to send it, rewrite the paid attachment to be of a more acceptable design.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated