Skip to content

nghiacr002/simplepush

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SimplePush

Send mail

use SimplePush;
$aConfigs = array(
	'method' => smtp //or mail
    'host' => smtp.gmail.com
    'user' => hello@fwebshop.com
    'password' => hellopass
    'authenticate' => tls // or ssl
    'port' => 587
);
$aMessage = array(
	'subject' => "Hello Mail"
    'content' => "Mail content"
    'from' => hello@fwebshop.com

);
$oInstance = new SimplePush\Mail($aConfigs);
$oInstance->message($aMessage);
$oInstance->to("nicetomeetyou@fwebshop.com");
$oInstance->send();
$mResults = $oInstance->getResults();
$aTmpError = $oInstance->getErrors();

Push to Android device

use SimplePush;
$aConfigs = array(
    'app_mode' => "production" //or development
    'api_access_key' => "Project API Key got from Google"
    
);
$aMessage = array(
   'command' => '2',
   'message' => 'Hello Android', 
   'your_param' => 'your_value'

);
$oInstance = new SimplePush\Android($aConfigs);
$oInstance->message($aMessage);
$oInstance->to("device_token_id");
$oInstance->send();
$mResults = $oInstance->getResults();
$aTmpError = $oInstance->getErrors();

Push to iOS device

use SimplePush;
$aConfigs = array(
    'app_mode' => "production" //or development
    'certification_file' => "Link to pem file"
    'password' => "" // passphrase for certificated file. 
   
);
$aMessage = array(
   'aps' => array(
      'alert' => 'Hello iOS',
      'sound' => 'default'
   )

);
$oInstance = new SimplePush\IOS($aConfigs);
$oInstance->message($aMessage);
$oInstance->to("device_token_id");
$oInstance->send();
$mResults = $oInstance->getResults();
$aTmpError = $oInstance->getErrors();

About

Easy to push notfication to Android/iOS and Email

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages