Last active
May 2, 2016 08:25
-
-
Save profnandaa/b8acba7c74ff1ae3696e00982ed7706d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Our previous code, getting details from MPesa IPN | |
// send SMS (AfricasTalking API) | |
$recipients = "+" . $_REQUEST["mpesa_msisdn"]; | |
$message = "Dear " . $_REQUEST["mpesa_sender"] . ", we acknowledge receipt of Ksh. " . $_REQUEST["mpesa_amt"] . " for " . $_REQUEST["mpesa_acc"] . ". Thanks for your support and God bless. FOCUS - Reaching Students Changing Nations."; | |
include_once("sms/send_sms.php"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//Sending Messages using sender id/short code | |
require_once('AfricasTalkingGateway.php'); | |
$username = "our-user-name"; | |
$apikey = "xxxxx-our-key-xxx"; | |
// Specify your AfricasTalking shortCode or sender id | |
$from = "FOCUSKenya"; | |
$gateway = new AfricasTalkingGateway($username, $apikey); | |
$results = $gateway->sendMessage($recipients, $message, $from); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment