Skip to content

Instantly share code, notes, and snippets.

@pawl
Last active August 29, 2015 14:09
Show Gist options
  • Select an option

  • Save pawl/3c41005ce10dfc716a75 to your computer and use it in GitHub Desktop.

Select an option

Save pawl/3c41005ce10dfc716a75 to your computer and use it in GitHub Desktop.
An example of the ClientAdd WHMCS hook for Brandon
<?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