Skip to content

Instantly share code, notes, and snippets.

@sluc23
Created July 10, 2019 08:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sluc23/559061a18e6bd87d64ad50b102af40ca to your computer and use it in GitHub Desktop.
Save sluc23/559061a18e6bd87d64ad50b102af40ca to your computer and use it in GitHub Desktop.
Add SendGrid X-SMTPAPI Headers
--- CRM/Mailing/BAO/Mailing.php 2019-05-15 20:00:28.000000000 +0200
+++ CRM/Mailing/BAO/Mailing.php.new 2019-07-10 10:56:06.561926552 +0200
@@ -1034,6 +1034,14 @@
if ($isForward) {
$headers['Subject'] = "[Fwd:{$this->subject}]";
}
+
+ // Add SendGrid X-SMTPAPI Headers
+ $json_string = ['category' => $this->name];
+ if ($event_queue_id) {
+ $json_string['unique_args'] = ['event_queue_id' => $event_queue_id];
+ }
+ $headers['x-smtpapi'] = json_encode($json_string);
+
return [&$verp, &$urls, &$headers];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment