Jump to content

Anybody have a working SMS Action Hook?


Recommended Posts

Does anyone have a WORKING action hook to use for sending a SMS when a support ticket is opened or replied to?

 

Here's what I've been trying and I keep getting PHP errors, not sure why ... this is running on a CentOS box .. everything worked fine and then I upgraded my version of WHMCS and it stopped working ... it's actually using sendmail to send through class.phpmailer-lite.php but I'd rather have it just send a regular sms text message to my phone ... I have looked EVERYWHERE and everthing says it can be done but I can't find anyplace that tells you exactly how to do it ...

 

TIA!

 

CODE:

 

<?php function SendSMS_TicketAlert($vars)

{

// $vars = func_get_args();

// $to = 'xxxxxxxxx@vtext.com';

// $dept = $vars['deptname'];

// $subject = 'New Ticket';

// $body = 'Hi,\n\nYou have a new Support Ticket\nDept: $dept';

// if (mail($to, $subject, $body))

// {

// echo("<center><p>Message successfully sent!<br /><br /><a href='http://xxxxxxx.xxxxxxxxxx.com'>Click Here To Return to the Support Portal</a></p></center>");

// }

// else

// {

// echo("<p>Message delivery failed...</p>");

// }

require("class.phpmailer-lite.php");

$mail = new PHPMailerLite();

$mail->SetFrom('xxxxxx@xxxxxxxxx.com', 'Support');

$mail->AddAddress("xxxxxxxxxxxxx@vtext.com", "Mobile");

// $mail->AddAddress("ellen@example.com"); // name is optional

$mail->WordWrap = 50; // set word wrap to 50 characters

// $mail->AddAttachment("/var/tmp/file.tar.gz"); // add attachments

// $mail->AddAttachment("/tmp/image.jpg", "new.jpg"); // optional name

$mail->IsHTML(false); // set email format to HTML

$mail->Subject = "Check Support Tickets";

$mail->Body = "A new or updated support ticket has been entered into the system";

$mail->AltBody = "Check the Support System for new and updated tickets";

if(!$mail->Send())

{

echo "Message could not be sent. <p>";

echo "Mailer Error: " . $mail->ErrorInfo;

exit;

}

}

add_hook("TicketOpen",0,"SendSMS_TicketAlert");

add_hook("TicketUserReply",1,"SendSMS_TicketAlert");

add_hook("TicketAdminReply",2,"SendSMS_TicketAlert");

 

?>

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated