Skip to content

Instantly share code, notes, and snippets.

@sendpulse
Last active May 4, 2021 21:12
Show Gist options
  • Save sendpulse/8bf33ff86a6617816661 to your computer and use it in GitHub Desktop.
Save sendpulse/8bf33ff86a6617816661 to your computer and use it in GitHub Desktop.
SendPulse REST API Usage Example foк PHP (https://sendpulse.com/api)
<?php
// SendPulse's PHP Library: https://github.com/sendpulse/sendpulse-rest-api-php
require_once( 'api/sendpulseInterface.php' );
require_once( 'api/sendpulse.php' );
$SPApiProxy = new SendpulseApi( API_USER_ID, API_SECRET, 'file' );
$email = array(
'html' => 'Your email content goes here',
'text' => 'Your email text version goes here',
'subject' => 'Testing SendPulse API',
'from' => array(
'name' => 'Your Sender Name',
'email' => '[email protected]'
),
'to' => array(
array(
'name' => 'Subscriber Name',
'email' => '[email protected]'
)
)
);
var_dump( $SPApiProxy->smtpSendMail( $email ) );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment