Hal9000 Posted May 22, 2022 Share Posted May 22, 2022 Hi there! I am faced with a problem I don't really know how to solve. Under some circumstances, I want the "Invoice Created" email not to be sent. For this, I am using the "EmailPreSend" hook. So far, so good. However, inside the hook I need a way to determine if the invoice (which I can get through $vars['relid']) was created from a new order, or if it was created via daily cron for renewal of services. My first attempt, which seemed logical, was to check if there is an order with the invoiceid set in the "tblorders" table. Sadly, I found out that this column only gets set AFTER the invoice creation email is being sent. Any ideas how I could get the information I need, or am I doomed? 0 Quote Link to comment Share on other sites More sharing options...
DennisHermannsen Posted May 22, 2022 Share Posted May 22, 2022 Maybe it would work if you check whether the the relid for the tblinvoiceitem row already exists for other rows? If it exists more than once, the product/domain has already been invoiced before. 0 Quote Link to comment Share on other sites More sharing options...
othellotech Posted June 13, 2022 Share Posted June 13, 2022 There is a renewals field on the tblorders, if that's filled in it's a domain renewal 🙂 Although I think you're using "renewal" to mean more than just domains - the recurring / next invoice for servcies etc - in which case, you'd really only know by checking if it's the 1st invoice for that id i.e. (tblhosting/tbldomains/tblupgrades/etc).orderid=tblorders.id 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.