
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
send-php-api
Advanced tools
With this Sendy PHP API Wrapper you can do the following:
| SUBSCRIBERS | LISTS | CAMPAIGNS |
|---|---|---|
| Subscribe | Set List | Create |
| Unsubscribe | Get List | Draft |
| Delete subscriber | Active subscriber count | Send |
| Subscription status | List Segments handling | Assign to brands |
Getting started is easy. Here's how you do it. You can check the example.php file as well. Obviously, you'll have to download the wrapper to your current setup. Several ways to do that.
Git clone this repo and include ./src/Sendy.php in your project.
Composer Install is the preferred method.
composer require ahmadawais/sendy-php-api
// New way using PSR4 Standard autoloader. Recommended
require_once . '/vendor/autoload.php';
// Old way of requiring all files manually. Not recommended.
require_once( 'API.php' );
// 2. Configuration.
$config = [
'sendyUrl' => 'https://send_installation_url.com', // Your Sendy installation URL (without trailing slash).
'apiKey' => 'XXXXXXXXXXXXXXXX', // Your API key. Available in Sendy Settings.
'listId' => 'XXXXXXXXXXXXXXXX',
];
use AhmadAwais\Sendy\API as Sendy;
$sendy = new Sendy( $config );
subscribe().unsubscribe().subStatus().delete().subCount().campaign().// Method #1: Subscribe.
$responseArray = $sendy->subscribe(
[
'email' => 'your@email.com', // This is the only field required by sendy.
'name' => 'Name', // User name (optional).
'custom' => 'Field Value', // You can custom fields as well (optional).
'country' => 'US', // User 2 letter country code (optional).
'ipaddress' => 'XX.XX.XX.XXX', // User IP address (optional).
'referrer' => 'https://AhmadAwais.com/', // URL where the user signed up from (optional).
'gdpr' => true, // GDPR compliant? Set this to "true" (optional).
]
);
$responseArray = $sendy->unsubscribe( 'your@email.com' );
$responseArray = $sendy->subStatus( 'your@email.com' );
$responseArray = $sendy->delete( 'your@email.com' );
$responseArray = $sendy->subCount();
// Method #6: Campaign — Draft And/Or Send as well.
$responseArray = $sendy->campaign(
array(
'from_name' => 'Your Name',
'from_email' => 'your@email.com',
'reply_to' => 'your@email.com',
'title' => 'Title', // the title of your campaign.
'subject' => 'Your Subject',
'plain_text' => 'An Amazing campaign', // Optional.
'html_text' => '<h1>Amazing campaign</h1>',
'brand_id' => 1, // Required only if you are creating a 'Draft' campaign. That is `send_campaign` set to 0.
'send_campaign' => 0, // SET: Draft = 0 and Send = 1 for the campaign.
// Required only if you set send_campaign to 1 and no `segment_ids` are passed in.. List IDs should be single or comma-separated.
'list_ids' => 'XXXXXXXX, XXXXXXXX',
// Required only if you set send_campaign to 1 and no `list_ids` are passed in. Segment IDs should be single or comma-separated.
'segment_ids' => '1',
// Lists to exclude. List IDs should be single or comma-separated. (optional).
'exclude_list_ids' => '',
// Segments to exclude. Segment IDs should be single or comma-separated. (optional).
'exclude_segments_ids' => '',
'query_string' => 'XXXXXXXX', // Eg. Google Analytics tags.
)
);
// Method #7: Change the `XXXXXXX` you are referring to at any point.
$sendy->setListId( 'XXXXXXX' );
// Method #7: Get the `XXXXXXX` you are referring to at any point.
$sendy->getListId();
The response of this PHP wrapper is custom-built. At the moment, it always returns a PHP Array. This array has the status of your action and an appropriate message in the response.
status is either true or false.message is based on the type of action being performed // E.g. SUCCESS response.
[
'status' => true,
'message' => 'Already Subscribed'
];
// E.g. FAIL response.
[
'status' => false,
'message' => 'Some fields are missing.'
];
KEY: 📦 NEW, 👌 IMPROVE, 🐛 FIX, 📖 DOC, 🚀 RELEASE, and ✅ TEST
I use Emoji-log, you should try it and simplify your git commits.
(follow) To stay up to date on free & open-source software
(follow) To get #OneDevMinute daily hot tips & trolls
(subscribe) To tech talks & #OneDevMinute videos
Me (Ahmad Awais) and my incredible wife (Maedah Batool) are two engineers who fell in love with open source and then with each other. You can read more about me here. If you or your company use any of my projects or like what I’m doing then consider backing me. I'm in this for the long run. An open-source developer advocate.
FAQs
Sendy PHP API Wrapper: Complete API interfacing
We found that send-php-api demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.