Tap Forms – Organizer Database App for Mac, iPhone, and iPad › Forums › Script Talk › Creating emails from TapForms
Tagged: email
- This topic has 1 reply, 2 voices, and was last updated 5 years, 1 month ago by john cesta.
-
AuthorPosts
-
September 21, 2019 at 10:32 AM #36818
Daniel LeuParticipantI’m using TapForms as a simple CRM tool and once in a while, I need to send emails using content from a record. Using a field with the type ’email’ opens the mailtool, but doesn’t provide a way to add a subject or message content.
But I found that I can trick Tapforms into launching the email tool using a “mailto:” web link! And with “mailto:” I can set the email subject and body as well.
So in my form, I have a field called “Send Email” of the type ‘Web Site’. Using a script, I set this field with a mailto link and additional content derived from my customer record. The mailto link then looks like “mailto:email@company.com?subject=…@body=…”.
Then I have a script field called ‘Create Email’ which contains following code:
// Create Email URL String function createEmailURL( recipient, subject, message) { var subject_field = subject ? "subject=" + subject : "set subject"; var message_field = message ? "&body=" + message: ""; var url = "mailto:" + recipient + "?" + subject_field + message_field; return url; } function Script() { var send_email_id = 'fld-c3fbfda318c5412fb5be8ecf2e0e7e3a'; var name = record.getFieldValue('fld-00336938a7d340a58d47a7231fe497dd'); var email = record.getFieldValue('fld-09e0ebeccf814d4b920e4021cf824997'); var message = "Dear " + name; message += "\n\nThis is my message for you!"; message += "\n\nRegards - Daniel"; var url = createEmailURL(email, "Member update", message); record.setFieldValue(send_email_id, url); document.saveAllChanges(); return url; } Script();
Whenever I update a field used in my script, the Send Email field is updated. Perfect! Unfortunately, I have to do a cmd-R (Refresh Selected Record) to have the GUI reflect the update as well. It would be so good to have a Record.Refresh() function to do this from a script (Brendan, are you listening? :)!
Once done, clicking on the Web Site link, the mailtool is opened with the prepared email.
This is not efficient if one needs to send hundreds of emails, but it is perfect for one or just a few.
September 21, 2019 at 12:00 PM #36821
john cestaParticipantThank you sir. I thought that perhaps we could use the calculation field to string some stuff together using text and fields.
FYI the way I send hundreds of emails is by using a webased thing called sendinblue
It’s free for up to 300 emails a day and unlimited contacts.
I’m getting ready to do my first mailing.
I select the records in tf and export to sendinblue.Seems to works fairly well.
I have another question in this project I’ll post it Into the forum so it won’t get lost.
-
AuthorPosts
You must be logged in to reply to this topic.