add_filter('mepr-wp-mail-recipients', function($recipients, $subject, $message, $headers) { // Block receipt emails for these gateways (match the exact text you see in the email) $blocked_gateways = [ 'Bezmaksas', 'Offline Payment', 'Manuāls bankas pārskaitījums', ]; // Try to read the gateway from the email body line we added: "Payment method: ..." if (preg_match('/Payment method:\s*(.+)/i', wp_strip_all_tags($message), $m)) { $gw = trim($m[1]); foreach ($blocked_gateways as $blocked) { if (strcasecmp($gw, $blocked) === 0) { return []; // no recipients => don't send } } } return $recipients; }, 20, 4);
  • You don't have access to purchase this item.