Jump to content

Invoice Paid Email Notification

Recommended Posts

I am looking for a way to send an email to a 3rd party when a specific product type's invoice has been paid.

for example, When a client pays their due invoice for their VPS/Server plan, id like to send an email to another email address with the VPS plan's hostname/ip address.

What is the best way to do this?

A hook when an invoice is paid based on the product type of VPS/Server?

Or a WHMCS notification via email using API  and a custom api trigger using a email notification template?



Share this post

Link to post
Share on other sites

On InvoicePaid run a query to scan the invoice looking for product IDs you need:

SELECT id FROM tblhosting WHERE packageid IN ('1', '2', '3') LIMIT 1

Replace 1, 2 and 3 with IDs of your VPS/Server plans. If the query returns true you could SendEmail via API but the problem is that it doesn't let you specify a recipient. You have to autoload PHPMailer, load your SMTP settings from tblconfiguration, retreive the recepient and send the email. In this post I have already described this approach. I know it's boring but there's no other way 🙂

Edited by Kian

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.


Important Information

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