Skip to content

Instantly share code, notes, and snippets.

trouttdev / my_module.module
Created Feb 1, 2017
Reject an entire feed import if a required field in feeds_tamper fails
View my_module.module
* Implements hook_feeds_after_parse().
function my_module_feeds_after_parse(FeedsSource $source, FeedsParserResult $result) {
// $sql = "SELECT COUNT(*) FROM feeds_log WHERE request_time = " . REQUEST_TIME . " AND id = " . $source->id . " AND type LIKE '%feeds_tamper:required%'" ;
$number_of_prase_errors = db_select('feeds_log', 'f')
->fields('f', array('flid'))
->condition('request_time', REQUEST_TIME, '=')
trouttdev / CacheResponse.php
Created Jan 11, 2017
Simple Laravel 5 response caching
View CacheResponse.php
namespace App\Http\Middleware;
use Closure;
use Cache;
class CacheResponse
trouttdev /
Last active Nov 16, 2016
How to add CC and BCC fields to SparkPost API

How to send a SparkPost email via API with a CC and BCC

Originally I found this which only vaguely pointed me in the right direction, so I thought I'd create a gist of what ended up working for me.


To add a CC address, you have to two two things

  1. Add the address to your recipeints array, and set the header_to value to an address in the to field. So if you're sending the email to and CCing it to, the header_to for will need to be set to
  2. Add the email to the CC headers option in content object. If you have multiple emails, these should be comma separated.
You can’t perform that action at this time.