yournotify/yournotify-php-sdk

Official Yournotify SDK for engagement, automations, loyalty, referrals and rewards.

Maintainers

Package info

github.com/yournotify/yournotify-php-sdk

pkg:composer/yournotify/yournotify-php-sdk

Transparency log

Statistics

Installs: 4

Dependents: 0

Suggesters: 0

Stars: 1

Open Issues: 0

dev-master 2026-08-02 12:13 UTC

This package is auto-updated.

Last update: 2026-08-02 12:13:48 UTC


README

PHP SDK for the current Yournotify API.

Installation

To install the Yournotify PHP SDK, you can use Composer. Run the following command in your terminal:

composer require yournotify/yournotify-php-sdk

Usage

To use the Yournotify SDK, you need to include the autoload file and create an instance of the Yournotify class with your API key.

require 'vendor/autoload.php';

$yournotify = new Yournotify\Yournotify('YOURNOTIFY_API_KEY');
$yournotify->validateAuth();

Available Methods

Sending an Email

$response = $yournotify->sendEmail('Title', 'Subject', '<h1>Hello</h1>', 'Hello', 'running', 'sender@example.com', 'recipient@example.com', 'Name', ['key' => 'value']);
print_r($response);

Creating a Campaign

$response = $yournotify->createCampaign([
	'name' => 'WhatsApp campaign',
	'channel' => 'whatsapp',
	'template_id' => 'template_123',
]);

Sending an SMS

$response = $yournotify->sendSMS('Title', 'Subject', 'Hello', 'running', 'SENDER_ID', '+2348100000000', 'Name', ['key' => 'value']);
print_r($response);

WhatsApp, Push, and In-App

$yournotify->sendWhatsApp(['name' => 'WhatsApp', 'template_id' => 'template_123']);
$yournotify->sendPush(['name' => 'Push', 'title' => 'Hello', 'body' => 'Welcome']);
$yournotify->sendInApp(['name' => 'In-app', 'title' => 'Hello', 'body' => 'Welcome']);
$yournotify->testCampaign(['channel' => 'email', 'email' => 'person@example.com']);

Adding a Contact

$response = $yournotify->addContact('email@example.com', '+2348100000000', 'list_id', 'Contact Name', ['key' => 'value']);
print_r($response);

Getting All Contacts

$response = $yournotify->getContacts();
print_r($response);

Deleting a Contact

$response = $yournotify->deleteContact(123);
print_r($response);

Adding a List

$response = $yournotify->addList('Title', 'public', 'single');
print_r($response);

Getting All Lists

$response = $yournotify->getLists();
print_r($response);

Deleting a List

$response = $yournotify->deleteList(456);
print_r($response);

Deleting a Campaign

$response = $yournotify->deleteCampaign(789);
print_r($response);

Getting Campaign Stats

$response = $yournotify->getCampaignStats(123, 'email');
print_r($response);

Getting Campaign Reports

$response = $yournotify->getCampaignReports(123, 'sms');
print_r($response);

API Methods Reference

  • sendEmail($title, $subject, $html, $text, $status, $from, $to, $name, $attribs): Sends an email.
  • sendSMS($title, $subject, $text, $status, $from, $to, $name, $attribs): Sends an SMS.
  • addContact($email, $telephone, $list, $name, $attribs): Adds a contact to a list.
  • getContacts(): Retrieves all contacts.
  • deleteContact($id): Deletes a contact by ID.
  • addList($title, $type, $optin): Creates a new list.
  • getLists(): Retrieves all lists.
  • deleteList($id): Deletes a list by ID.
  • deleteCampaign($id): Deletes a campaign by ID.
  • getCampaignStats($ids, $channel): Retrieves campaign statistics.
  • getCampaignReports($ids, $channel): Retrieves campaign reports.
  • getRewards($params), createReward($data), sendReward($data): Works with rewards.
  • identify($data), track($data): Sends automation identity and event data.

Non-2xx responses throw RuntimeException with the response status code when available.

More Information

For full API reference, visit the Yournotify API Documentation.

License

This SDK is open-source and available under the MIT License.