You are here

function hook_sendgrid_integration_sent in SendGrid Integration 7

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

This hook is invoked after email has been sent.

Parameters

string $to: Address of email recipient

integer $result_code: http result code returned by drupal_http_request.

  • 2xx Request were successfull.
  • 4xx There were errors in parameters.
  • 5xx API call was unsuccessfull.

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

  • id Message id
  • uid User id
  • module Module witch sended the message

array $result_data: Result data returned by drupal_http_request.

1 invocation of hook_sendgrid_integration_sent()
SendGridMailSystem::mail in inc/sendgrid.mail.inc
Implement mail method to send mail via Sendgrid.

File

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

Code

function hook_sendgrid_integration_sent($to, $result_code, $unique_args, $result_data) {
  if ($unique_args['module'] == 'my_module' && ($result_code = 200)) {
    watchdog('My Module', 'My module has successfully sent email', NULL, WATCHDOG_NOTICE, $link = NULL);
  }
}