Creating New Client and Enabling PDF invoices to be attached

At the moment, when you create a new client you have to remember to navigate to the check box where you can enable PDF invoices to be attached to emails.
As I send out all my emails this way, it would be extremely helpful if this box could be checked by default whenever I create a new client.
I have already added the code that attaches a PDF copy of the invoice when I send an email, but I don’t know if this will override the check box at client creation.

HI @TheWriteCompany

While we don’t support this directly, there is an option to add a script that would also tick this when creating/editing a client. Please see the post, here: Can you advise A CSS script to disable Square - #4 by ian_roberts

However, this wouldn’t apply automatically to clients, they would have to be edited and saved for this box to be ticked.

Hope this helps.

Hello Mathew

Thanks, this looks like what I need. Unfortunately I’m not very confident with coding, so can you confirm that

<input id="chkallowAttachPDF" type="checkbox" name="chkallowAttachPDF" value="true" checked="checked">

needs to be replaced by

<input id="chkallowAttachPDF" type="checkbox" name="chkallowAttachPDF" value="true">…</input> – $0

For some reason, when I type the two dashes before the $0 in this email it automatically creates a long dash. Does this happen in coding or will it display as two dashes?

You’re mixing up two things here, the bit you’ve quoted (with the -- $0) is what you’re seeing in the dev tools, not what goes in the code. The dev tools screenshot in my previous post was just showing you how to find the right way to identify the element that you want to target. The id of the <input> element is what goes after the # in the selector expression:

$(function() {
  //Set enable attach PDF as Default
  $(".page-clients-modify #chkallowAttachPDF").prop("checked",true);
});

What this code is doing is saying when a page loads, if that page is the “modify client” page then make sure the “allow PDF” checkbox is ticked

$(".page-clients-modify #chkallowAttachPDF")

selects the element with ID chkallowAttachPDF, but only if it is inside an element with class page-clients-modify, i.e. we are on the “modify client” page. If we are not on the right page then the selector selects nothing and the function as a whole is a no-op.

1 Like

OK, thanks for the clarification.

image001.png

image004.png

image001.jpg