Oct 19, 2020 01:05 PM
Hey coding wizards. My company is using Airtable forms to manage customer orders inside of a club. When a new customer fills out a form, there is an “Email Address” field as well as a “Confirm Email Address” field. After the form is completed, an Automation sends an order confirmation email to the customer with the mailto: address being the “Email Address” field. But occasionally a customer will mistype their email address which will result in an Automation failure, requiring me to send the order confirmation manually. Since Airtable has yet to implement verification fields, I just use the backup email address and hope it’s correct.
I want a script that I can include into the automation that acts as an IF() statement. The logic being:
IF email automation results in a failure (aka the email address does not exist), then repeat the automation using “Confirm Email Address” field.
I feel like this could be a useful script for many service-driven workspaces in this community. If this is a simple integration I’d really appreciate any assistance since I don’t have coding experience. If not, if there’s anyone who can offer their services I’d be interested in learning more. Thanks!
Oct 21, 2020 01:02 PM
Bumping this post. Anyone who can help me out?
To clarify again, I need a script that will re-run an automation to a backup email address field IF the original automation fails.
Oct 21, 2020 03:59 PM
Is your current Automation using a Script action to send the email, or is it using the Email action?
Oct 22, 2020 03:05 PM
Thanks for the reply!
My automation is using the built in Gmail “Send email” feature.
Oct 22, 2020 03:15 PM
Unfortunately, I’m not aware of any way to access the status of an Automation run from within a Script.
The only way I could see your desired workflow working is if the entire process was handled inside a Script action. There are ways to send emails from JavaScript – the best ones are likely paid solutions, but I think I’ve seen some free ones out there too.
This way you could have a single Script action that attempts to send the email, via JavaScript, to the first email address, and checks the server response; if it fails, then it sends the email to the second email address.
Here are some solutions to look into:
Oct 22, 2020 03:21 PM
Thanks again for your response.
I can see here that there’s a Log that shows the status of automations. Could this be accessed using a script to show what has succeeded and what has failed?
Thanks.
Oct 22, 2020 03:26 PM
I’m not aware of any way to access that log from within a Script. I see nothing in the Script API documentation that would indicate an ability to access that Automation log metadata:
Oct 22, 2020 03:45 PM
Bummer, that’d be an excellent feature to have as Airtable continues developing the Automations feature!
I think for a temporary solution I’m going to set up a formula that checks if the email fields are the same, if not, it will flag the record. Then if I get a notification that the automation has failed, I’ll have a button placed that on click will execute a different automation that sends to the backup email address. It requires a bit of manual work, but we’re not ready to host our own SMTP server just yet!
Oct 22, 2020 03:50 PM
Makes sense.
FWIW, I fixed the link to emailjs.com (which got autocorrected in my first post), which I think can be used in conjunction with Gmail as your SMTP provider.
Oct 22, 2020 04:05 PM
I’ll definitely look into that then! thanks again for your help!