thewebmaster Posted March 16, 2014 Share Posted March 16, 2014 Hello, I am a newbie and do not know much about programming. I need to send an email to the customer after paying the invoice. I tried to use the hooks but due to less knowledge was not able to get it through. Below is my code and email template which I want to send mail is "Invoice Paid Feedback Mail" <?php function hook_InvoicePaid($vars) { $command = "SendEmail"; $adminuser = "admin"; $values = array( 'messagename' => 'Invoice Paid Feedback Mail',); $results = localAPI($command,$values,$adminuser); } add_hook("InvoicePaid",1,"hook_InvoicePaid"); ?> Please help me in achieving this. Thanks in advance. AKA 0 Quote Link to comment Share on other sites More sharing options...
thewebmaster Posted March 18, 2014 Author Share Posted March 18, 2014 Can Someone help me please? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted March 18, 2014 Share Posted March 18, 2014 doesn't the customer already receive an email after paying the invoice (or at least when payment is confirmed) - "Invoice Payment Confirmation"...?? could you modify that template to include the content of this additional email that you're trying to send ? alternatively, you may be able to tweak the email marketer to do this - http://docs.whmcs.com/Email_Marketer 0 Quote Link to comment Share on other sites More sharing options...
thewebmaster Posted March 18, 2014 Author Share Posted March 18, 2014 Hey Brain, Thanks for spending your time on my post. Actually I want to send two separate mails. One mail for invoice payment confirmation and another mail to ask the client about their experience on the whole process. For email marketer it will run via cron and I need to send it at the same time when an invoice is marked paid. It would be great if you can help me with the hooks coding. AKA 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted March 18, 2014 Share Posted March 18, 2014 Actually I want to send two separate mails. One mail for invoice payment confirmation and another mail to ask the client about their experience on the whole process.For email marketer it will run via cron and I need to send it at the same time when an invoice is marked paid. personally, I'm not sure if I were a customer whether I would like this... depending on your setup, as a new customer I might receive a welcome email, an invoice email, a payment confirmation email and then your feedback email... it might not be a bad idea to delay the feedback email (if you must send it separately) to give the customer some time to reflect on the process rather than send them numerous emails. it might also depend on your feedback method - are you expecting them to email you back or directing them to a survey/questionnaire web link? if it's a web link, then I would just include it in the payment confirmation email. 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.