Get the SMS alternate field

avid
Kilo Expert

Hi.

My client   SMTP server doesn't provide the ability to send SMS messages.

Instead i implemented an   SMS sending method that gets string message and the phone number and send it to 3rd party SMS sender provider.

The method tested and works fine when i manually send   values to the method.

I wants to expend this   capability and use it on existing notification with SMS alternate field.   The text should be taken from the "SMS alternate" field. The number should be taken from the receptions phone number in the notification.

My problem is that i cannot find the SMS message body anywhere.

The sys_email tables (emails log)   provide me the body only for the email messages formatted with html, but i cannot find any text that indicate that any SMS been sent or should be send.

I wants to grab the SMS text   (not the original field in the notification form, because in that case i'm losing the variables values) , and send it to my method as the message string.

Thank you for your help.

3 REPLIES 3

Dale Meyer-Cur1
Mega Contributor

The SMS Alternate field is on the email template form (sysevent_email_template).     To find this, go to System Policy>Email>Templates, and open any existing template "SMS Alternate" is on the bottom of the form.


But in that case i'm losing the variables values.



Let's take this scenario as an example:



In each incident that been closed,   the caller will receive an SMS with the incident number and   short message.



so i built a new notification   with this condition and without any template. in the alternate SMS i wrote:



Hello   ${caller_id}


Incident   ${number} closed...



So now every time an incident will be closed, the notification will be fire, but every time with a different the variables hold different values. i want to grab the entire text for each notification with the variables values   and sent it to my method.


At the SMS Alternate on the bottom of the form inside the template or the notification itself , i can only grab the source code.


This does not address your problem of being able to perform what you want through a notification - however you also have the option to just execute your code through a Business Rule that watches for an Incident to close (and whatever other logic you want). This is how we have done our text messaging because it is an integration with Twilio (third party provider) and calls out via REST. When the conditions are met it executes a call to Twilio - no "notification" is needed.




I have little experience using the SMS features built in because it does not work for us (we would need to know the cellular provider to send them a message), and we did not want to pay for the "Notify" plugin that ServiceNow offers. I would be pleasantly surprised if you could easily write code to work with these built-in fields for your third party SMS provider - but I am not holding my breath that it will be easier than just doing a business rule. If it is - that would be awesome - but I have never seen a place to configure your own SMS provider (like Twilio) out of the box.