Add a button to send a contact's portal via SMS

Add a button to the view contact screen to send the portal link to a contact via SMS.

Updated over a week ago

In this scenario, we will customize the View Contact screen to add a button to send a message to the contact via SMS using their mobile number. This message will include a URL link to their portal.

Additionally, we will create a new activity to log the link was sent.

NOTE: This article will require a basic understanding of Method customization.

Customize the View Contact screen

  1. Open up any contact and customize the screen.

  2. Since this is a stock screen, you'll need to create a new copy of it (if you haven't already in the past).

  3. Scroll down and find the section called secPortalLink. Add a new column to this. (You could always place this link somewhere else, however, for brevity's sake, we will add it here).

  4. Drag in a new text object to this column and caption it "SMS portal". While there, align the cell to the upper right.

  5. Go into the text object's click event to add actions.

Add Actions to the new Text Object

To send an SMS, we will use two fields from the screen. However, if these fields are not populated, then the process should stop with a notification. Thus, we need a conditional statement.

  1. Add the action Conditional statement.

  2. For the condition to check, we will check that the mobile field is populated. The tricky part here is figuring out which one is the label header, and which one is the field to display the mobile number. The field to check is called mobile (doesn't have the number 1). So set the condition where the field Mobile is not empty.

  3. The next condition check should see if the portal link has been generated. However, it is only generated when an email exists, so the next condition will check if an email exists. Add another condition where the field Email is not empty.

  4. Great, put in an Internal Note to help identify what the conditional statement is doing.

  5. Click the plus on the If..then action so the next added action is within that statement.

  6. Add a Show Message action to ask for confirmation from the user. Fill in the Title and Message as you wish. I added in the contact's name to help identify who the SMS will be sent to.

  7. Make sure for the Show Message action the buttons OK/Cancel are being shown then add in an internal note.

  8. The next action will create the message to send. Add in Character functions action.

  9. For the Character Functions action, keep the default Join action, and set the parameters as follows. (Feel free to choose your own message and don't forget the internal note).

    • Join this: "To log into your secure Method portal, click the following link: "

    • With this: Set to the field PortalURL

    • Store result in: Create new action result resultSMSBody

  10. For the next action, add the Send SMS action.

  11. The parameters for this should be straightforward.

    • Recipient's phone number: Set to the field Mobile.

    • Message: Set this to the existing action result resultSMSBody.

Your final action set should look similar to this:

We're not done yet though. Best practice is to log any type of interaction we would have with our contact. So we should add in an activity.

Create an Activity to log the SMS sent

  1. First, we need to create the text body for the activity. Add another Character functions action right after the Send SMS action.

  2. For this Character Functions action, keep the default Join action, and set the parameters as follows. (Feel free to choose your own message and don't forget the internal note).

    • Join this: "Sent the following SMS:"

    • With this: Use existing action result resultSMSBody

    • Store result in: Create new action result resultActivityBody

  3. Add in the action Insert Records Into Table. We will manually enter in an activity record into the activity table.

  4. For Select a table, choose the Activity table and keep Insert As to New Record.

  5. Fill in the following for the first required fields:

    • ActivityType - Display: Make sure to type in exactly "SMS Outgoing"

    • AssignedTo - RecordID: User - Record ID
      (Switch this from Display to RecordID, and then select the session value User - RecordID)

    • DueDateStart: Use the session value Current Date / Time.

  6. Click โŠ• Add another field to add three more fields, and populate them with the following.

    • Contacts - RecordID: Use the session value Screen Active Record ID.

    • ActivityStatus - Display: Make sure to type in exactly "Completed"

    • Comments: Use the existing action result resultActivityBody.

  7. Finally, create an action result to store the newly created Activity's Record ID, and then also add in an internal note.

And we're almost done! You're action set should look like this now.

Add in an Else action

To finish things off, we should add in an else statement if the email or the mobile number is not populated.

  1. Add in a Show Message action within the Else. Ensure the action is embedded within the Else and not outside of the conditional statement.

  2. For this action, put in a message the Email and Phone fields must be populated. If you wish to be fancy, you can add in HTML tags to highlight the fields in the message.

Great! Now we're done! Your final action set should look like this:

Close the action set, and close the designer. Your View Contact screen should now have the link you created beside the portal link.

Clicking it will send an SMS to the mobile number. Test it with one of your own numbers to ensure it works.

NOTE: If SMS Delivery is not enabled in your account, you will need to turn it on in Account under Communications.

If you are satisfied, Publish the screen and your new customization will be visible to all users!

Did this answer your question?