You are here

function hook_sendgrid_integration_unique_args_alter in SendGrid Integration 8

Same name and namespace in other branches
  1. 8.2 sendgrid_integration.api.php \hook_sendgrid_integration_unique_args_alter()
  2. 6 sendgrid_integration.api.php \hook_sendgrid_integration_unique_args_alter()
  3. 7 sendgrid_integration.api.php \hook_sendgrid_integration_unique_args_alter()

This hook is invoked before mail is sent, allowing modification of unique_args.

Parameters

array $unique_args: Unique arguments.

array $message: The email message

Return value

array Returned array will be used as unique arguments.

1 invocation of hook_sendgrid_integration_unique_args_alter()
SendGridMail::mail in src/Plugin/Mail/SendGridMail.php
Sends a message composed by \Drupal\Core\Mail\MailManagerInterface->mail().

File

./sendgrid_integration.api.php, line 46
Hooks provided by SendGrid Integration module.

Code

function hook_sendgrid_integration_unique_args_alter($unique_args, $message) {
  $unique_args['time'] = time();
  $unique_args['subject'] = $message['params']['subject'];
  return $unique_args;
}