No. We need hook to trigger when an invoice is created whether or not email is sent. In our present logic, we disable the invoice email with the Order API request which includes invoice creation.
I had considered the InvoiceCreationPreEmail hook which indicates that it 'Executes as an invoice is being created in the admin area before the email is being sent'. When I posed the inquiry to WHMCS support, they indicated this would not work, because we are creating the invoice w/o sending the email.
WHMCS Support recommended InvoiceCreated hook, but in the documentation it indicates 'Executed when an invoice has left “Draft” status and is available to its respective client. Execution of this hook occurs after sending the Invoice Created email.' So it seems it would not work with that hook, because email is NOT being sent.
InvoiceCreation hook does not seem appropriate, unless we add code to check whether status was published before taking action.
What would be best course of action?