本文整理汇总了PHP中sms::sendSMS方法的典型用法代码示例。如果您正苦于以下问题:PHP sms::sendSMS方法的具体用法?PHP sms::sendSMS怎么用?PHP sms::sendSMS使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sms
的用法示例。
在下文中一共展示了sms::sendSMS方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct($input)
{
parent::__construct($input);
if (parent::checkHasContents($this->fInput['body']) == true) {
parent::getTags();
foreach ($this->tags as $tag => $group) {
debug::output("\n\nChecking tag... {$tag} ...\n\n");
$okay = $this->inputValidation($tag);
if ($okay == false) {
continue;
}
parent::formatTagArray($tag);
}
//foreach tag
if (!empty($this->errors)) {
parent::logErrors();
parent::sendErrors();
}
//if errors
if (!empty($this->valid)) {
foreach ($this->valid as $tag => $array) {
debug::output("Checking lost bag report for tag {$tag}");
$lostBag = $this->getLostBagLocation($tag);
$this->send['body'] = $this->lostBagMessage($lostBag[0], $tag);
parent::sendSMS();
}
//foreach valid tag
}
//if valid tags
} else {
//no pin number supplied
$lostBag = $this->getLostBagLocation();
if (is_array($lostBag)) {
foreach ($lostBag as $key => $array) {
$this->send['body'] = $this->lostBagMessage($array);
parent::sendSMS();
}
//foreach lost tag
} else {
$this->send['body'] = 'There are no reports available for your mobile number.';
parent::sendSMS();
}
}
//else
}
示例2: __construct
public function __construct($input)
{
parent::__construct($input);
$this->getTags();
foreach ($this->tags as $nothing => $tag) {
debug::output("\n\nChecking tag... {$tag} ...\n\n");
$okay = $this->inputValidation($tag);
if ($okay == false) {
continue;
}
$this->formatTagArray($tag);
}
//foreach tag
if (!empty($this->errors)) {
parent::logErrors();
foreach ($this->errors as $tag => $message) {
debug::output($message);
$this->send['body'] = $message;
parent::sendSMS();
}
//foreach error
unset($this->errors);
}
//if errors
if (!empty($this->valid)) {
foreach ($this->valid as $tag => $array) {
debug::output("Cancel tag {$tag}");
$okay = $this->cancelTag($tag);
if ($okay == false) {
$this->send['body'] = $this->errors[$tag];
parent::sendSMS();
} else {
$this->send['body'] = "Tag {$tag} has been canceled.";
parent::sendSMS();
}
}
//foreach valid tag
}
//if valid tags
if (!empty($this->errors)) {
parent::logErrors();
}
}
示例3: __construct
public function __construct($input)
{
parent::__construct($input);
/*
* Make sure tag is not empty
*/
if (parent::checkHasContents($this->fInput['body']) == true) {
parent::getTags();
foreach ($this->tags as $tag => $group) {
debug::output("\n\nChecking tag... {$tag} ...\n\n");
$okay = $this->inputValidation($tag);
if ($okay == false) {
continue;
}
parent::formatTagArray($tag);
}
//foreach tag
if (!empty($this->errors)) {
parent::logErrors();
parent::sendErrors();
}
//if errors
if (!empty($this->valid)) {
foreach ($this->valid as $tag => $array) {
debug::output("Registering tag {$tag}");
$this->logDB->logValidTags($tag, $this->phone_number);
if ($array['type'] == 'PAPER') {
$this->send['body'] = "Tag {$tag} ready to be activated text PIN ACTIVATE to proceed. Tag valid for 3 months. Text cost £{$array['cost']} each plus standard network rate. Text PIN STOP to cancel.";
} else {
//plastic
$this->send['body'] = "Tag {$tag} ready to be activated text PIN ACTIVATE to proceed. Tag valid for 1 year. Text cost standard network rate each. Text PIN STOP to cancel.";
}
parent::sendSMS();
}
//foreach valid tag
}
//if valid tags
}
//not empty
}
示例4: __construct
//.........这里部分代码省略.........
$mail->protocol = config::get('config_mail_protocol');
$mail->parameter = config::get('config_mail_parameter');
$mail->hostname = config::get('config_smtp_host');
$mail->username = config::get('config_smtp_username');
$mail->password = config::get('config_smtp_password');
$mail->port = config::get('config_smtp_port');
$mail->timeout = config::get('config_smtp_timeout');
$mail->setTo($this->customer_details['email']);
$mail->setFrom('');
$mail->setSender('');
$mail->setSubject(html_entity_decode(sprintf('Lost Bag Report')));
$report_foundbag_emailtext = "Dear " . $this->customer_details['firstname'] . " <br /> \n\nA lost bag report has been completed and your tag number has been reported.<br /><br />\n\nDetails of the find<br />\n<b>Tag Number: OC </b>" . $this->customer_details['tag_no'] . "<br />\n<b>Name of Finder:</b>" . " " . $this->customer_details['firstname'] . " " . $this->customer_details['lastname'] . "<br />\n<b>Email Address of Finder:</b>" . " " . $this->customer_details['email'] . "<br />\n<b>Telephone Number of Finder:</b>" . " " . $this->customer_details['telephone'] . "<br />\n<b>Mobile Number:</b>" . " " . $this->customer_details['mobile'] . "<br />\n<b>Post Code:</b>" . " " . $this->customer_details['postcode'] . "<br />\n<b>Location of Bag:</b> {$lostBag['airport']}, {$lostBag['place']}, {$lostBag['state']}, {$lostBag['country']}<br /><br />\n\nSincerely</n>\nLost Baggage Team";
$mail->setText(strip_tags($report_foundbag_emailtext));
// echo "<pre>";
// print_r($mail);
// die;
$mail->send();
// End mail for ACTIVE TagNo
$this->logCheckLostBagTagInboxNotified($tag, $iata, $world_tracer_ref, true, 'email', $this->customer_details['email']);
$this->logDB->logCheckLostBagEmail($this->customer_details['customer_id'], strip_tags($report_foundbag_emailtext), $this->customer_details['email'], $status, $tag);
} else {
//not active
debug::output("{$tag} inactive. Notify user by email.");
/* Owner recieves an email to ask them to contact
* who will provide them with the information once they
* have paid a fee.
* (Would like to automate this so email is kept in
* user's acocunt until they have paid a premium of
* £15.00 then they can view the report)*/
//****This mail function is for mailing ACTIVE Tag holder email****//
$mail = new Mail();
$mail->protocol = config::get('config_mail_protocol');
$mail->parameter = config::get('config_mail_parameter');
$mail->hostname = config::get('config_smtp_host');
$mail->username = config::get('config_smtp_username');
$mail->password = config::get('config_smtp_password');
$mail->port = config::get('config_smtp_port');
$mail->timeout = config::get('config_smtp_timeout');
$mail->setTo($this->customer_details['email']);
$mail->setFrom('');
$mail->setSender('');
$mail->setSubject(html_entity_decode(sprintf('Lost Bag Report')));
//print_r($this->customer_details);
$report_foundbag_emailtext = "Dear " . $this->customer_details['firstname'] . " <br /> \nA lost bag report has been completed and your tag number has been reported.<br /><br /> \nBut we are sorry, your tag is not ACTIVE please call " . config::get('lost_bag_number') . " to reactivate your tag.<br /><br />\n\nSincerely</n>\nLost Baggage Team";
$mail->setText(strip_tags($report_foundbag_emailtext));
// echo "<pre>";
// print_r($mail);
// die;
$mail->send();
// End mail for ACTIVE TagNo
$this->logCheckLostBagTagInboxNotified($tag, $iata, $world_tracer_ref, true, 'email', $this->customer_details['email']);
$this->logDB->logCheckLostBagEmail($this->customer_details['customer_id'], strip_tags($report_foundbag_emailtext), $this->customer_details['email'], $status, $tag);
}
//else
} else {
//not registered
debug::output("{$tag} has no registered email address ");
//is the account 'active'?
if ($this->checkTagNoStatus($tag) == 'ACTIVE') {
debug::output("{$tag} active\n");
//Owner receives SMS to say a report is waiting for you, please text YES to receive the details, text costs £1.50 or NO to cancel
$this->send['destinations'] = utils::formatPhoneNumber($this->customer_details['telephone']);
$this->logCheckLostBagTagInboxNotified($tag, $iata, $world_tracer_ref, true, 'sms', $this->send['destinations']);
$this->send['body'] = 'Lost bag report available for tag ' . $tag . '. For details text PIN REPORT. Text costs £1.50 each plus standard network rate. Text PIN STOP to cancel.';
parent::sendSMS();
} else {
debug::output("{$tag} inactive\n");
//not active
/*user recieves text to say account not active please contact
* directly on [telephone number] potentially we automate this and
* have them go online to pay the fee before receiving the info -
* your thoughts would be helpful*/
$this->send['destinations'] = utils::formatPhoneNumber($this->customer_details['telephone']);
$this->send['body'] = 'Lost bag report available for EXPIRED tag ' . $tag . '. Please contact customer services on ' . config::get('lost_bag_number') . ' Text PIN STOP to cancel.';
parent::sendSMS();
$this->logCheckLostBagTagInboxNotified($tag, $iata, $world_tracer_ref, true, 'sms', $this->send['destinations']);
}
//else
}
//else not registered
} else {
debug::output("{$tag} not registered to customer in database");
if (!$old_lost_tags_invalid[$tag]) {
$this->logDB->logCheckLostBagInvalidTag($tag);
//only log the tag once
}
}
} else {
debug::output("{$tag} invalid format\n");
$this->logDB->logCheckLostBagInvalidTag($tag, $old_lost_tags_invalid);
}
unset($this->send);
}
//for each message
} else {
debug::output("No messages in Inbox\n");
}
//empty
imap::i()->close();
}
示例5: __construct
public function __construct($input)
{
parent::__construct($input);
if ($this->getValidTags() == false) {
debug::output("There are no tags pending activation against this phone number: {$this->phone_number}");
$this->send['body'] = 'There are no tags pending activation against this phone number. For support call customer services on ' . config::get('customer_services');
parent::sendSMS();
} else {
foreach ($this->tags as $tag => $array) {
debug::output("Checking tag... {$tag} ...");
$okay = $this->tagValidation($tag);
if ($okay == false) {
continue;
}
$this->valid[$tag] = $array;
}
//foreach tag
if (!empty($this->errors)) {
parent::logErrors();
parent::sendErrors();
}
//if errors
if (!empty($this->valid)) {
$this->customer = new customer($this->logDB);
debug::output("Create customer account...");
$result = $this->customer->createCustomerAccount($this->phone_number);
if ($result['success'] == false) {
debug::output($result['message']);
$this->errors[] = $result['message'];
} else {
//iterate through each tag and register each tag
foreach ($this->valid as $tag => $array) {
debug::output("Register tag {$tag}");
$this->registerTag($tag);
parent::updateTagGroup($tag);
$this->logDB->unLogValidTags($tag);
$registerd[$tag]['message'] = 'Tag ' . $tag . ' activated successfully. ';
$registerd[$tag]['tag_type'] = $array['tag_type'];
}
//foreach tag
}
if (!empty($this->errors)) {
parent::sendErrors();
parent::logErrors();
}
//if errors
/*
* send as few sms as possible each time
*/
if (!empty($registerd)) {
foreach ($registerd as $tag => $array) {
debug::output($message);
$activation_m .= $array['message'];
//$array['tag_type']; use type to determine premium or free sms
}
//foreach valid
$this->send['body'] = $activation_m . $result['message'];
$this->sendSMS();
}
//if not empty
}
//else
}
//else
}