Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if (!defined("WHMCS"))
- die("This file cannot be accessed directly");
- use WHMCS\Database\Capsule;
- add_hook('TicketOpenValidation', 1, function($vars) {
- $useremail = strtolower($vars['email']);
- if (!filter_var($useremail, FILTER_VALIDATE_EMAIL)) {
- return 'Invalid email format.';
- }
- $blocked = Capsule::table('tblticketspamfilters')
- ->where('type', 'sender')
- ->where('content', $useremail)
- ->exists();
- if ($blocked) {
- return 'Sorry, you cannot open a ticket.';
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment