Skip to content

Instantly share code, notes, and snippets.

@sebmih
Created August 30, 2013 05:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sebmih/6386571 to your computer and use it in GitHub Desktop.
Save sebmih/6386571 to your computer and use it in GitHub Desktop.
A script based on the GitHub library that enables the Subscription Tracking app.
<?php
include 'sendgrid-php-master/SendGrid_loader.php';
$sendgrid = new SendGrid('*******', '*******');
$mail = new SendGrid\Mail();
$mail->
addTo('sebi.mihalache@gmail.com')->
setFrom('sebastian.mihalache@sendgrid.com')->
setSubject('Kvitto din kförs betalning nördlichen blabla Hemisphäre ciment')->
setText('Testing %name% subject.')->
addUniqueArgument("uid:", "sebGmail")->
//addSubstitution("%name%", array("John"))->
setHtml('<p>Testing <i>%name%</i> subject.</p>')->
addFilterSetting("subscriptiontrack", "enable", 1)->
addFilterSetting("subscriptiontrack", "text/plain", "If you would like to unsubscribe and stop receiving these emails click here: <% %>.")->
addFilterSetting("subscriptiontrack", "text/html", "If you would like to unsubscribe and stop receiving these emails <% click here %>");
$sendgrid->smtp->send($mail);
echo 'Great Success!';
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment