Jbl Posted May 6, 2018 Share Posted May 6, 2018 I wanted to send an email on InvoicePaid so I wrote a hook like this: function add_client($vars) { $userid = Capsule::table('tblorders')->where('invoiceid', '=', $vars['invoiceid'])->value('userid'); $command = 'SendEmail'; $postData = array( '//example1' => 'example', 'messagename' => 'Access Info', 'id' => $userid, '//example2' => 'example', 'customtype' => 'product', 'customsubject' => 'Product Welcome Email', 'custommessage' => '<p>Thank you for choosing us</p><p>Your custom is appreciated</p><p>{$custommerge}<br />{$custommerge2}</p>' ); $adminUsername = 'admin'; // Optional for WHMCS 7.2 and later $results = localAPI($command, $postData, $adminUsername); print_r($results);} } add_hook("InvoicePaid",1,"add_client") And a custom email template named Access Info with arbitrary text. This returns: Array ( [result] => success ) but no email is being sent. There is even no trace of the email in the system email message log. Other emails like Order Confirmation and Invoice Payment Confirmation are sent, so the mail configuration is not the issue here. I'm I missing something? 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.