Jake Vanderwerf
2026-08-28 a9654f00c8fbc9934289d761843ddd071025013f
inc/integrations/services/PostMarkOld.php
@@ -1,7 +1,10 @@
<?php
namespace JVBase\integrations\services;
use Exception;
use JVBase\integrations\Integrations;
use WP_Error;
if (!defined('ABSPATH')) {
   exit;
}
@@ -158,8 +161,8 @@
      // Determine content type
      $is_html = $parsed_headers['content-type'] === 'text/html' ||
         strpos($message, '<html') !== false ||
         strpos($message, '<body') !== false;
         str_contains($message, '<html') ||
         str_contains($message, '<body');
      // Build PostMark payload
      $payload = $this->buildEmailPayload(
@@ -293,7 +296,7 @@
         return true;
      } catch (\Exception $e) {
      } catch (Exception $e) {
         $this->logError('[POSTMARK]', ['method' => 'sendEmail', 'error' => $e->getMessage()]);
         return new WP_Error(
            'postmark_send_failed',
@@ -357,7 +360,7 @@
      switch ($name) {
         case 'content-type':
            if (strpos($value, 'text/html') !== false) {
            if (str_contains($value, 'text/html')) {
               $parsed['content-type'] = 'text/html';
            }
            break;
@@ -386,7 +389,7 @@
         default:
            // Store custom headers
            if (strpos($name, 'x-') === 0) {
            if (str_starts_with($name, 'x-')) {
               $parsed['x-headers'][] = [
                  'Name' => $parts[0], // Original case
                  'Value' => $value
@@ -513,7 +516,7 @@
            $this->cache->set($cache_key, $stats, 3600); // Cache for 1 hour
            return $stats;
         }
      } catch (\Exception $e) {
      } catch (Exception $e) {
         $this->logError('stats/outbound', ['error' => $e->getMessage()]);
      }
@@ -530,7 +533,7 @@
            'count' => $count,
            'offset' => $offset
         ]);
      } catch (\Exception $e) {
      } catch (Exception $e) {
         $this->logError('[POSTMARK]', ['method' => 'getBounces', 'error' => $e->getMessage()]);
         return [];
      }