12
Views
13
Comments
Solved
Setting up a condition to determine which SMS to send
Question

Hi Community,

I am looking to send a different SMS message to a user based on his/her ticket status. But there is a particular status that has two different messages. Would need help to find a way to toggle between the message based on other condition besides the status. 

Example: 

1) When the user submits a ticket, the status of the ticket is set to "Confirmed". An SMS with Message "A" will be sent to the user mobile number base on the "Confirmed" Status.

2) On the other hand when the admin triggers the ticket sent by the user using the trigger SMS button, an SMS with Message "B" will be sent to the user mobile number. (Notice the status of the ticket is still "Confirmed".

TiggerSms Action (Main Module): 

TiggerSMS Action (Core Module): 

GetSMSContentByStatus: I don't know what to set for my condition to toggle between the messages. 

Thought of counting the number of SMS (If SMS>1 = otherwise), but I don't know how to implement it.


Please advice. Thank you so much in advance. 

mvp_badge
MVP
Rank: #71
Solution

Hi Alvin,

Let me propose another solution if I understood your use case correctly.

Why don't you simply create an Input Parameter of type Boolean for your TriggerSMS action (something like SendSpecialSMS or you can come up with a better name). 

Now for the Trigger SMS button that only the Admin uses, you can do the same and pass the value True to the TriggerSMS action and otherwise if the TriggerSMS action is NOT called via the Trigger SMS button you pass the value False.

This way if the TriggerSMS action is called with SendSpecialSMS = True, you can send message B, and if it is SendSpecialSMS = False you send message A.

Regards,

Nordin

mvp_badge
MVP
Rank: #18

Hi Alvin,

Your Admin will have something like an Admin role so use the Check<Role_name>Role.HasRole  function to see if the user is Admin to differentiate the message that you want to send.

Regards,

Daniel 

Rank: #593

Hi Alvin,

Can you store the messages number with the particular ticket after sending each message in an entity and while sending a message from admin you can check it the message number count is greater than or equal to 1 if it is true you can send Message B

hope it will resolve your issue

Regards,

Krushna

mvp_badge
MVP
Rank: #18

You wrote:

1) When the user submits a ticket, the status of the ticket is set to "Confirmed". An SMS with Message "A" will be sent to the user mobile number base on the "Confirmed" Status.

2) On the other hand when the admin triggers the ticket sent by the user using the trigger SMS button, an SMS with Message "B" will be sent to the user mobile number. (Notice the status of the ticket is still "Confirmed".


So the condition to sent Message A should always  based on the fact that it is a new status being submitted, you know this by checking the Ticket Id prior to adding it to the database. 

To send Message B the Ticket Id must <> NullIdentifier() and the Role of the user needs to be Admin.

mvp_badge
MVP
Rank: #71
Solution

Hi Alvin,

Let me propose another solution if I understood your use case correctly.

Why don't you simply create an Input Parameter of type Boolean for your TriggerSMS action (something like SendSpecialSMS or you can come up with a better name). 

Now for the Trigger SMS button that only the Admin uses, you can do the same and pass the value True to the TriggerSMS action and otherwise if the TriggerSMS action is NOT called via the Trigger SMS button you pass the value False.

This way if the TriggerSMS action is called with SendSpecialSMS = True, you can send message B, and if it is SendSpecialSMS = False you send message A.

Regards,

Nordin

Rank: #5201

Thank you Daniel and Krushna for your help as well :)

mvp_badge
MVP
Rank: #71

Glad I could help Alvin :)