Nov 04, 2024 10:00 PM
Hi,
I'm looking at abstractifying our e-mail contents to streamline the process. E-mail content is now stored in the automations itself, but I'd like to move it to a dedicated table. Our automations use a fair bit of dynamic content, such as <first name> in the opening line, derived from various "Find Records" steps.
I tried to construct the desired e-mail content with a "List of <first name>" token and just copy/paste it to a Long Text field with formatting turned on. Airtable changed the variable to @Unknown and threw an error "Invalid data - you have to refresh the page", and didn't store anything of the pasted text.
Is there way to build the whole e-mail content including variables into a template stored in a table?
Rgds,
Björn
Nov 04, 2024 10:26 PM
Hey @0800-grizzly
Sounds like a great move to centralize email templates and streamline the automation setup. To achieve this, I’d suggest setting up a dynamic templating system within Airtable, storing email templates in a dedicated table. We can use placeholders like <first name> in the templates, then reference these dynamically using "Find Records" steps and a scripting action to replace them with actual values at runtime.
To bypass the "Invalid data" error, I’ll help format the templates within Airtable’s long text fields, making use of Airtable's formula functions where possible. This ensures placeholders are correctly processed before sending, and you’ll have an easy-to-update central repository for all email content.
Nov 05, 2024 02:56 AM
And you don’t even need to use scripting for this if you don’t want to, You can just create formulas that substitute the variables of your email templates with record values.
But you would need to lookup those templates into the table where you want to use them, by creating a linked record field and linking every record to the template.
Hope this helps! If you’d like to hire an expert Airtable consultant to help you with anything Airtable-related, please feel free to contact me through my website: Airtable consultant — ScottWorld
Nov 05, 2024 10:36 AM
Thanks for you reply. Do I understand your approach right, that it would mean using CONCATENATE fields that would sum up the mail content, then to be placed into the formula via a Find Records step? If yes, it doesn't sound appealing due to the amount of different cases and therefore amount of fields.
Rgds,
Björn
Nov 05, 2024 10:38 AM - edited Nov 05, 2024 10:38 AM
You don't need a find records step. You would just create a formula using nested SUBSTITUTE() functions to substitute your <<merge fields>> with whatever fields you would like to use instead.
Nov 05, 2024 10:39 AM
Thanks for your reply. Do I understand you right, that the actual template record would have e.g. <FirstName> in place of the first name, then in the automation a script step would identify real variables in the earlier Find Records steps, and substitute the <FirstName> with it's real variable? Sounds tricky to maintain, I guess all "value pairs" would need to be hard code defined, non?
Rgds,
Björn
Nov 05, 2024 11:04 AM
I'm sorry, I don't understand. In the automation "Message" box I can insert a dynamic token to fetch data from a table, and that requires identifying it in a previous step. How else would we recognise it if not with a Find Record?
Further, wouldn't my variables in the data still not get recognised by the automation?
Rgds,
Björn
Nov 07, 2024 06:04 AM
@Sachin_191 and @ScottWorld, sorry to disturb. Could I ask for you elaborate on my questions above?
Cheers,
Björn