Official Laravel package for the current Yournotify API.
composer require yournotify/yournotify-laravelSet these environment variables:
YOURNOTIFY_API_KEY=your_api_key
YOURNOTIFY_API_URL=https://api.yournotify.com/Publish config if needed:
php artisan vendor:publish --tag=yournotify-configuse Yournotify;
Yournotify::sendEmail(
'Welcome Campaign',
'Welcome',
'<p>Hello</p>',
'Hello',
'draft',
'noreply@smtp.yournotify.net',
[['email' => 'person@example.com', 'name' => 'Person']]
);
Yournotify::sendWhatsApp([
'name' => 'WhatsApp campaign',
'template_id' => 'template_123',
]);
Yournotify::createReward(['name' => 'Referral reward']);
Yournotify::track(['event' => 'checkout.completed', 'external_id' => 'user_123']);sendEmail(...)sendSMS(...)sendWhatsApp(...)sendPush(...)sendInApp(...)testCampaign(...)addContact(...)getContact(...)getContacts(...)updateContact(...)deleteContact(...)addList(...)getList(...)getLists(...)updateList(...)deleteList(...)getCampaign(...)getCampaigns(...)updateCampaign(...)deleteCampaign(...)getCampaignStats(...)getCampaignReports(...)getRewards(...)createReward(...)sendReward(...)getRewardProducts(...)getRewardAnalytics(...)getRewardSubmissions(...)identify(...)track(...)getProfile()
Failed API responses throw RuntimeException with the Yournotify response message when available.