Kuovonne's Extensions & Scripts
Share
Explore
Scripts

icon picker
Email Table Companion Automation Script

Use this script in conjunction with an Email table created by the to automatically generate email records. (This script does not unlock features of the extension itself.)
Note that the email table must have a very specific configuration for this script to work:
The Email Table must be named Emails.
The templates view must be named Templates. (The extension does not create this view for you.)
The fields in the table must match the defaults created by the Email Table extension. If you manually created your email table or adjusted any of the fields after it was created, your table may be missing fields or have different names.
This minified script is not human readable or editable.

Getting the script

Configuration

Understanding the template system

If you do not already have the Email Table extension, install it and complete the configuration to use the extension. This script uses the same table, view, fields, and templates as the Email Table extension.
Make sure you understand how the system and templates work before attempting to use this script.

Configuring the automation scripting action

Open the script editor and paste in the entire script. (You can open the script using a plain text editor.) It is normal to have a red bar on the right side of the script editor after pasting in the script. You do not need to do any edits in the script itself (unless your table, view, and field names do not match).
On the left side of the script editor, add the four input variables:
recordId Select the blue plus to pick the record ID of the record you want to merge.
recordTableName Type the name of the table for the record you want to merge. (Do not use the blue plus.)
templateName Type the name of the template you want to use. If the name of the template you want to use is a field value, you can select that field in from the blue plus.
emailStatus Type the value of you want for the {Status} field in newly created records in the Email table.
Test the automation and verify that the record is created in the Email table.

image.png

Sending the email immediately

The script only creates the record in the Email table, just like the Email Table extension. You still need to actually send the email.
Use a different automation to send emails that only sends emails. This works best if you have several different methods of creating email records or if you want a pause to review the email record before sending it.
Add a Send email action to the same automation. This works best if you do not have a separate automation for sending emails and want to immediately send the email without using another automation run. You will need a Find records action to find the newly created email by the record ID output by the script. Note that you will also need a formula field in the Email Table that exposes the record IDs.
image.png

Sending the email later

The script only creates the record in the Email table, just like the Email Table extension. If you want to be able to preview or edit the merged content before sending the email, you can set the {emailStatus} to a pending value. Then have a separate automation actually send the email after you manually change the status to ready to send.

Customizing table, view, and field names

You should use the same table, view, and field names as those created by the . However, if you need to change the names, you can edit the names in the script.
image.png

Share
 
Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
CtrlP
) instead.