Jump to content

Invoice Paid Email Notification


RFEHosting

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?

Thanks

 

Link to comment
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
Link to comment
Share on other sites

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