You are here

function hook_sendgrid_integration_sent in SendGrid Integration 8

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

This hook is invoked after email has been sent.

Parameters

string $to: Address of email recipient.

array $unique_args: Unique arguments used when email were sent, keyed by argument name.

  • id Message id.
  • uid User id.
  • module Module witch sent the message.

array $response: Response from the SendGrid API.

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

File

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

Code

function hook_sendgrid_integration_sent($to, $unique_args, $response) {
  if ($unique_args['module'] == 'my_module' && ($result_code = 200)) {
    \Drupal::logger('My Module')
      ->notice('My module has successfully sent email');
  }
}