<?php
date_default_timezone_set("America/Mexico_City");
require_once('Services/Twilio.php');

class TwilioService 
{
	private $client;
	private $sId = "AC84ad53d733e729fb2519787612bbf785";
    private $token = "f8517e5e8ae5e2a63668103f27290cae";        	
    private $from;

	public function __construct( $from )
	{
        $this->client = new Services_Twilio($this->sId, $this->token);                
        $this->from = $from;
	}

	public function sendSMSMessage( $to, $message )
	{	
		try {
			
			$message = [
                "From"  => $this->from,
                "To"    => $to,
				"Body" => $message
			];
            
            $response = $this->client->account->messages->create( $message );             

			return $response;
		}catch(Exception $e){
			print_r( $e );
			return false;
		}                        
	}
}
?>