Skip to content

Instantly share code, notes, and snippets.

View KevinGraham-com's full-sized avatar

KevinGraham-com

View GitHub Profile
<?php
add_hook('EmailPreSend', 1, 'disableSomeMails');
function disableSomeMails($vars) {
// update the 11 below to whichever hour you run this task at.
if (date('g') == 11 AND $vars['messagename'] == "Credit Card Payment Failed") {
return array('abortsend' => 'true');
} else {
<?php
require_once '/home/whmcs/public_html/init.php';
// update above to your WHMCS folder
$capturetotal=0;
$invoicescaptured=0;
$paymethodstried=0;
$command=array(
'status' => 'Overdue',
'orderby' => 'duedate',
@KevinGraham-com
KevinGraham-com / uptimerobot.php
Created December 11, 2023 05:20
WHMCS - Uptime Robot Heartbeat on Daily Cron
<?php
add_hook('DailyCronJob', 1, 'uptimeRobotCron');
function uptimeRobotCron($vars) {
$ch = curl_init("https://heartbeat.uptimerobot.com/xxxxxxx");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_exec($ch);
curl_close($ch);
}
@KevinGraham-com
KevinGraham-com / syncuserclient.php
Created August 30, 2023 08:32
WHMCS - Sync User and Client Email on Update
<?php
if (!defined('WHMCS')) {
exit('This file cannot be accessed directly');
}
add_hook('UserEdit', 5, 'sync_user_to_client');
add_hook('ClientEdit', 5, 'sync_client_to_user');
function sync_user_to_client($vars) {
// gather the data
@KevinGraham-com
KevinGraham-com / fastmail.php
Created March 18, 2023 13:48
Fastmail Masked Aliases Creator
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="robots" content="noindex,nofollow">
<title>Masked Emails</title>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-rbsA2VBKQhggwzxH7pPCaAqO46MgnOM80zW1RWuH61DGLwZJEdK2Kadq2F9CUG65" crossorigin="anonymous">
</head>
<body>
@KevinGraham-com
KevinGraham-com / .htaccess
Created June 19, 2022 12:56
Bunny Fonts .htaccess Rules
AddOutputFilterByType SUBSTITUTE text/html
Substitute "s|fonts.googleapis.com|fonts.bunny.net|i"
Substitute "s|fonts.gstatic.com|fonts.bunny.net|i"