PHP code example of ibonly / laravel-etextemail

1. Go to this page and download the library: Download ibonly/laravel-etextemail library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

ibonly / laravel-etextemail example snippets


composer 

"ibonly/laravel-etextmail: 1.0.*"

 Ibonly\EtextMail\EtextMailServiceProvider::class,

'aliases' => [
    ...
    'EtextMail' => Ibonly\EtextMail\Facades\EtextMail::class,
    ...
]

php artisan vendor:publish --provider="Ibonly\EtextMail\EtextMailServiceProvider"

return [
    'senderid' => getenv('ETEXTMAIL_SENDER'),

    'username' => getenv('ETEXTMAIL_EMAIL'),

    'password' => getenv('EXTEXTMAIL_PASSWORD'),

    'url'      => getenv('ETEXTMAIL_URL'),
];

ETEXTMAIL_SENDER=xxxxx
ETEXTMAIL_EMAIL=xxxxx
EXTEXTMAIL_PASSWORD=xxxxx
ETEXTMAIL_URL=http://mail.etextmail.com

use EtextMail;

class SMS
{
	/**
	 * @return float
	 */
	public function getSMSBalance()
	{
		dd(EtextMail::getCreditBalance())
	}

	/**
	 * @param  $message [the message to be processed]
	 * @return int
	 */
	public function	messageCount($message)
	{
		dd(EtextMail::getMessageCount($message));
	}

	/**
	 * @param  $message [the message to be processed]
	 * @return int
	 */
	public function characterCount($message)
	{
		dd(EtextMail::getCharacterCount($message));
	}

	/**
	 * @param  $destination [reciever's mobile number]
	 * @param  message      [the message to be processed]
	 * @return boolean
	 */
	public function sendSMS($destination, $message)
	{
		dd(EtextMail::sendMessage($destination, $message));
	}

	/**
	 * @param  $destination [reciever's mobile number]
	 * @param  $message     [the message to be processed]
	 * @param  $longSMS     [number of pages]
	 * @return boolean
	 */
	public function sendLongSMS($destination, $message, $longSMS)
	{
		dd(EtextMail::sendMessage($destination, $message, $longSMS))
	}
	
	
}