Skip to content

Instantly share code, notes, and snippets.

View anildhiman03's full-sized avatar
🏠
Remote Work

Anil Kumar anildhiman03

🏠
Remote Work
View GitHub Profile
@anildhiman03
anildhiman03 / EmailController.php
Created August 16, 2022 10:21 — forked from fukuball/EmailController.php
Laravel 5.1 Controller that receives AWS SES Bounce and Complaint notifications sent via AWS SNS. It records the email addresses that bounced or complained in a database.
<?php
public function postBounceOrComplaint(Request $request, Mailer $mailer){
Log::info($request->json()->all());
if($request->json('Type') == 'SubscriptionConfirmation'){
$client = new Client();
$client->get($request->json('SubscribeURL'));
return response()->json();
@anildhiman03
anildhiman03 / PushNotifications.php
Created August 16, 2022 10:21 — forked from fukuball/PushNotifications.php
Simple PHP script to send Android Push Notification, iOS Push Notification and Windows Phone 8 Push Notification
<?php
// Server file
class PushNotifications {
// (Android)API access key from Google API's Console.
private static $API_ACCESS_KEY = 'AIzaSyDG3fYAj1uW7VB-wejaMJyJXiO5JagAsYI';
// (iOS) Private key's passphrase.
private static $passphrase = 'joashp';
// (Windows Phone 8) The name of our push channel.
private static $channelName = "joashp";
function Pubsub() {
this.events = {};
}
Pubsub.prototype.publish = function(event, args) {
if (!this.events[event]) {
return false;
}
var subscribers = this.events[event];