Skip to content

Instantly share code, notes, and snippets.

@cwicaksono
cwicaksono / sparkpost.php
Created April 1, 2019 11:48
Snippet to send email using sparkpost API
<?php
$title = "Title goes here"'
$email_title = "Email subject goes here";
$email_recipent = "email@domain.com";
$message = "Put your html email body in <strong>here</strong>";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.sparkpost.com/api/v1/transmissions');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);