How To Send an SMS in Sailforms

412 views
Skip to first unread message

Chris

unread,
Sep 11, 2014, 7:02:02 PM9/11/14
to sailfor...@googlegroups.com
With Version 1.9.9k you can now execute Android Uri Intents.

Here's how to send an SMS

Create a PHONE Text field and a BODY Text field.

Create a URI Text Field and add the math equation

="smsto:"+PHONE+"?sms_body="+encode(BODY)

You need to encode the Body to make sure special Uri values are encoded correctly.

You actually can do multiple values following the ?. Separate each with a &
Make sure your unknown values are encoded

?address=encode(Address)&body=encode(body)&more=encode(Value)



Add a button and set the command
Uri Intent SENDTO "yourForm" URI field

In Android Code it would look like this

Intent intent = new Intent(ACTION_SENDTO, Uri.parse("smsto:1234567890")
intent.putExtra("sms_body", BodyValue);
startActivity(intent);

Uri.xml

schotterfahrer

unread,
Sep 12, 2014, 2:45:40 AM9/12/14
to sailfor...@googlegroups.com
Hey interesting! Could we have this for email fields too? I mean BODY and SUBJECT?

technologic

unread,
Sep 12, 2014, 4:32:39 AM9/12/14
to sailfor...@googlegroups.com

Schotterfahrer,

You already have it for email

Uri_Email.xml

Octazid

unread,
Sep 12, 2014, 9:02:57 AM9/12/14
to sailfor...@googlegroups.com
Hi,
great stuff! And can we make an attachment to the mail?
Thanks!

technologic

unread,
Sep 12, 2014, 3:43:36 PM9/12/14
to sailfor...@googlegroups.com

Octazid,

I don’t think ‘mailto’  supports attachments.

Octazid

unread,
Sep 12, 2014, 10:42:39 PM9/12/14
to sailfor...@googlegroups.com
Ok, thanks!

Chris

unread,
Sep 15, 2014, 11:15:09 AM9/15/14
to sailfor...@googlegroups.com
mainto: requires the addresses to be an Array of names. I am thinking of a "Hack" way to do this.

Attachements are filenames.

davro

unread,
Aug 18, 2015, 7:50:48 PM8/18/15
to Sailforms Users
HI!

I am new to Sailforms and found it very useful

I am wondering how do I enter the "encode(BODY)" in the formula


Message has been deleted

MikeG

unread,
Aug 19, 2015, 4:47:13 AM8/19/15
to Sailforms Users
encode should be available as a command (URL encode text) in your URI text field, and body is a reference to the field holding the message body.

davro

unread,
Aug 20, 2015, 8:16:25 PM8/20/15
to Sailforms Users
Thanks MikeG. I will try that.

Doyler

unread,
Nov 21, 2017, 1:33:46 PM11/21/17
to Sailforms Users
Hi
I tried to enter   ="smsto:"...   and couldn't enter an = before the double quotes - how?

Also, why can Sailforms not introduce a very simple means of opening an SMS option from a phone icon in Sailforms in the same way as it opens an email option from an email icon?   This would then be universal throughout Sailforms no matter in which form a phone number occurred?   In the Mememto database clicking on a phone number gives 2 options - phonecall or SMS.  Surely this can't be very complicated?  In hope.  Mary

Chris

unread,
Nov 23, 2017, 1:31:02 PM11/23/17
to sailfor...@googlegroups.com
Here is how you send an SMS

Add a Text Field for the PHONE number.
Add a Text Field for the MESSAGE.

Add a Text Field for the SMS.
Setup a Math Equation for the SMS
"smsto:"+PHONE+"?sms_body="+encode(MESSAGE)

Add a Button
Add the command Uri Intent

Pick the action ACTION_SENDTO
Pick the Field SMS

Clicking on the button will execute the Android Action SEND_TO with the SMS as a Uri.
 
Since this is a Uri, the MESSAGE must be encoded to allow all characters. encode(MESSAGE)

Reply all
Reply to author
Forward
0 new messages