You are here

sparkpost.api.php in Sparkpost email 8.2

Same filename and directory in other branches
  1. 7.2 sparkpost.api.php
  2. 7 sparkpost.api.php

Hooks provided by the Sparkpost module.

File

sparkpost.api.php
View source
<?php

/**
 * @file
 * Hooks provided by the Sparkpost module.
 */

/**
 * Alter the sparkpost message before it gets sent to sparkpost.
 *
 * @param array $sparkpost_message
 *   The sparkpost message, about to be sent to the webservice.
 * @param array $message
 *   The Drupal message. That is, the array that is passed to the mail system.
 */
function hook_sparkpost_mail_alter(array &$sparkpost_message, array &$message) {

  // If the message is a specific type of mail, we want to alter the reply-to.
  if ($message['id'] == 'mymodule_some_key') {
    $sparkpost_message['content']['reply_to'] = 'noreply@example.com';
  }
}

Functions

Namesort descending Description
hook_sparkpost_mail_alter Alter the sparkpost message before it gets sent to sparkpost.