Repository URL to install this package:
|
Version:
2.0.2 ▾
|
novicell/dds_sendgrid
/
dds_sendgrid.api.php
|
|---|
<?php
/**
* @file
* Hooks provided by DDS SendGrid module.
*/
/**
* @addtogroup hooks
* @{
*/
/**
* This hook is invoked before mail is sent, allowing modification of
* unique_args.
*
* @param array $custom_arguments
* Unique arguments.
*
* @param array $message
* The email message
*
* @return array
* Returned array will be used as unique arguments.
*/
function hook_sendgrid_custom_arguments_alter($custom_arguments, $message) {
$custom_arguments['time'] = time();
$custom_arguments['subject'] = $message['params']['subject'];
return $custom_arguments;
}
/**
* This hook is invoked before mail is sent, allowing modification of
* categories.
*
* @param array $categories
* An array of categories for Sendgrid statistics.
*
* @param array $message
* The email message
*
* @return array
* Returned array will be used as categories.
*/
function hook_sendgrid_categories_alter($categories, $message) {
$categories[] = 'from_' . $message['from'];
$categories[] = $message['language'];
return $categories;
}
/**
* @} End of "addtogroup hooks".
*/