Last active
August 29, 2015 14:09
-
-
Save pawl/3c41005ce10dfc716a75 to your computer and use it in GitHub Desktop.
An example of the ClientAdd WHMCS hook for Brandon
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function send_invitiation_email($vars) { | |
| $command = "sendemail"; | |
| $adminuser = "secret"; | |
| $values["messagename"] = "Google Groups Invitation"; | |
| $values["id"] = $vars['userid']; | |
| $results = localAPI($command, $values, $adminuser); | |
| // auto-invite to announcements list | |
| $to = "[email protected]"; | |
| $subject = "Add me to the mailing list!"; | |
| $message = "Hello! Please add me to the announcements mailing list."; | |
| $from = $vars['email']; | |
| $headers = "From:" . $from; | |
| mail($to, $subject, $message, $headers); | |
| } | |
| // more documentation: http://docs.whmcs.com/Hooks:ClientAdd | |
| add_hook("ClientAdd", 1, "send_invitiation_email"); | |
| ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment