telepet Posted August 9, 2016 Report Share Posted August 9, 2016 I'm in the brainstorming phase. Members of our staff would like to send emails out to our clients via their email application of choice-- like Outlook, etc. I have a table of 20-400 clients that includes email address information. Any ideas on how I can get those email addresses inside a "To:" field and send out an email? I'm open to exploring Caspio doing this for me but I understand that might not be possible due to inherent anti-spamming design. I'm also concerned with data usage in Caspio. Note: I have wondered about using Javascript to copy email to the system clipboard but this doesn't see like good practice, and I'm only a novice JS user at this point. That said, this post got me thinking more on that: <button id="demo" onclick="copyToClipboard(document.getElementById('demo').innerHTML)">This is what I want to copy</button> <script> function copyToClipboard(text) { window.prompt("Copy to clipboard: Ctrl+C, Enter", text); } </script> Quote Link to comment Share on other sites More sharing options...
MayMusic Posted August 9, 2016 Report Share Posted August 9, 2016 Have you looked through Zapier to see if there is any app to perform m this on a Caspio table? https://zapier.com/ Quote Link to comment Share on other sites More sharing options...
telepet Posted August 9, 2016 Author Report Share Posted August 9, 2016 Thanks for the suggestion. Zapier looks wonderful, especially the Mail Chimp integration. Unfortunately, I'm not able to allow third party providers access to the data I have inside of Caspio. I'm experimenting with creating a View that contains just one column: emails of clients that are active. I don't label the emails, and so the final output is a simple list of emails. I adjusted the above code, replacing This is what I want to copy with a the data source field for client emails, so: <button id="demo" onclick="copyToClipboard(document.getElementById('demo').innerHTML)">@field:CLIENT_EMAIL</button> <script> function copyToClipboard(text) { window.prompt("Copy to clipboard: Ctrl+C, Enter", text); } </script> What this does is place a button underneath each email and allows me to copy the given email one at a time. So, now I need to figure out a way to collect all the emails, concatenate them with ";" and paste to the system clipboard... The search is ongoing. Thanks again for your advice on Zapier. Quote Link to comment Share on other sites More sharing options...
aam82 Posted August 10, 2016 Report Share Posted August 10, 2016 There are some buggy ways to prepopulate the user's email program with a list of emails. One bug that I don't like is the opening of a new tab as a side-effect. Another is call to location.href with a mailto: link getting served over http, causing a mixed contect warning. There is also the window prompt you linked to, which has a 2,000 character limit. Since you have fewer than 999 addresses in the data set you want to use, you won't run into the 999 record per page Caspio limit, so I suggest the following, adapted from the second response to the same SO thread you linked: In your datapage footer, add the following code <p id="emailCount"></p> <textarea id="emailOutput" style="width: 500px; height: 200px;"></textarea> <p> <button class="js-textareacopybtn">Copy Emails to clipboard</button> </p> <SCRIPT LANGUAGE="JavaScript"> var elems = document.getElementsByTagName("td"); var copiedEmails = []; var numEmails = 0; for (var i=0, m=elems.length; i<m; i++) { if (elems[i].innerText.includes("@")) { copiedEmails.push(elems[i].innerText); numEmails += 1; } } var joinedEmails = copiedEmails.join("; "); document.getElementById("emailOutput").innerHTML= joinedEmails; document.getElementById("emailCount").innerHTML= "Found " + numEmails + " emails."; </script> <script> var copyTextareaBtn = document.querySelector('.js-textareacopybtn'); copyTextareaBtn.addEventListener('click', function(event) { var copyTextarea = document.getElementById("emailOutput"); copyTextarea.select(); try { var successful = document.execCommand('copy'); var msg = successful ? 'successful' : 'unsuccessful'; console.log('Copying text command was ' + msg); } catch (err) { console.log('Oops, unable to copy'); } }); </script> Which searches for strings containing an "@" character, adds each to an array, then joins the array with "; " for better pasting into an email client. It also displays a count of addresses found: telepet 1 Quote Link to comment Share on other sites More sharing options...
telepet Posted August 10, 2016 Author Report Share Posted August 10, 2016 @aam82: Brilliant! I also didn't realize Caspio could do more than 250 records per page, so this work-around should work well for my purposes. Wish this form allowed me to give you points or something. I'll hit the "♥ Like This" button. Thank you! Quote Link to comment Share on other sites More sharing options...
Kurumi Posted December 17, 2018 Report Share Posted December 17, 2018 Hi @telepet , You can try Caspio's standard feature such as Triggered Action or Tasks. Find more information on these links: https://howto.caspio.com/tables-and-views/triggered-actions/https://howto.caspio.com/tasks/ Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.