Jump to content

Help to make an action hook for email generated invoice when customers uses EAN / GLN


Recommended Posts

To WHMCS forum members

 

I need some help to create an invoice action hook.

 

I have customers that uses the EAN / GLN invoice system.

Invoices with the attached PDF file should be sent to the designated vendor (same mail address for all customers) collecting all EAN / GLN invoices which then will be distributed electronically to the final instances within the government, counties, schools and other official entity.

This is a requirement within DK and EU if you want to send invoices to government, counties, schools and other official entity.

There is a small WIKI about GLN : https://en.wikipedia.org/wiki/Global_Location_Number

 

The WHMCS system doesn't seem to be able to handle EAN invoices, so I am not able to invoice my customers within the government, counties, schools and other official entity.

Yes, I can do it manually by downloading the invoices (if you know which PDF it is) and send them manually to the designated mail address at the vendor collecting these. But that's not working in an automatically system as WHMCS.

 

I can't use it as a standard (extra) mail recipient within the invoice template because it's only relates to customers from government, counties, schools and other official entity.

 

WHMCS support tells me that I could create a new contact (ensuring you don't have sub accounts enabled) and place the email in as follows:

 

abc+client1@domain.com

abc+client2@domain.com

 

Both of these emails will be sent to abc@domain.com

But then the system will send invoices, reminders, over due and payment mails, and that doesn't work either.

 

 

I could also try to utilize an Action Hook on specific customers as mentioned in the URL.

https://developers.whmcs.com/hooks-reference/invoices-and-quotes/#invoicecreation

 

Unfortunately I don't have a master's degree in hooks within WHMCS and therefore seek some guidance to accomplish this.

 

 

I have added an extra customer field so that the customer can type an EAN / GLN number.

Then the system should utilize the Action Hook if this field is used, properly do some regex to validate it, and send the invoice to invoice@eancollector.tld.

The action hook should only be activated on new generated invoices and not on reminders, overdue mails and so on.

Only the first invoice with the attached PDF should be sent out.

 

I look forward to get some help on this topic, thanks in advance everyone :)

 

- Tim

Link to comment
Share on other sites

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • 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