You are here

protected function MailgunMail::checkTracking in Mailgun 8

Checks, if the mail key is excempted from tracking.

Parameters

array $message: A message array.

Return value

bool TRUE if the tracking is allowed, otherwise FALSE.

1 call to MailgunMail::checkTracking()
MailgunMail::buildMessage in src/Plugin/Mail/MailgunMail.php
Builds the e-mail message in preparation to be sent to Mailgun.

File

src/Plugin/Mail/MailgunMail.php, line 295

Class

MailgunMail
Default Mailgun mail system plugin.

Namespace

Drupal\mailgun\Plugin\Mail

Code

protected function checkTracking(array $message) {
  $tracking = TRUE;
  $exceptions = $this->mailgunConfig
    ->get('tracking_exception');
  if (!empty($exceptions)) {
    $exceptions = str_replace([
      "\r\n",
      "\r",
    ], "\n", $exceptions);
    $tracking = !in_array($message['module'] . ':' . $message['key'], explode("\n", $exceptions));
  }
  return $tracking;
}