Nov 12, 2020 02:16 AM
Hello everyone,
I’m currently failing on something pretty easy to solve I think.
I’d like to create an automation that will send an email when a record matches certains conditions. I also want this email to contain an attachment that is always the same (PDF file), that is not in my airtable.
I cannot find any easy solution. Does someone have one ?
Thank you
Franck
Solved! Go to Solution.
Nov 12, 2020 06:32 AM
There are at least two things wrong with this statement:
This process doesn’t actually import anything into the record. Instead, it is either being attached (in which case it creates a new attachment link) OR the attachment link from the source table where it was originally attached is being copied. In either case, the file itself (a binary image in this case) does not exist in the record. File attachments in Airtable records are by reference (i.e., links); not by value (i.e., actual files).
As you point out, copying file references from one table into another upon creation of a new record achieves nothing except, it makes a new attachment (by reference) which ultimately makes a copy of the original file in your Airtable account, a process that – over time – will erode the storage quota of your Airtable account needlessly.
Ergo, this is an attachment “by reference”, not “by value”.
This is the prime directive of your requirements - an email with [one of] the designated attached files. Before discussing the best approach to achieve this requirement, let’s understand how Gmail works with links and actual attachments.
Despite the recommendation to import the three documents into Airtable, it leaves you with only a URL to work with and this fails the prime directive.
Document URLs placed into Gmail do not automatically cause the referenced file to be “attached” by value. They just become links in the email body.
There is one – and only one – exception to the second bullet point; if the URL points to a Google Drive document that exists within the same gmail account used to create the email automation, said document will be linked (by reference) and also attached (by value).
One Approach
Store your three PDF documents in Google Drive; expose them as accessible to “Anyone with the link…”.
Determine the direct URLs to each of the three documents such that they can be directly downloaded.
Modify your action process to chose which of the three Google Drive documents should be included in the email and embed such directly downloadable URLs into the email message.
Ensure that the Gmail account authenticated for the action process uses the same Google account where the three documents are stored.
Emails dispatched with this configuration should include both the link to the document and the document attached to the email message. Note, it is possible to conceal the long Google Drive URL in the message by using a little HTML so that your messages are prettier - this will not impact the ability of Gmail to perform the attachment.
Nov 12, 2020 02:41 AM
I am pretty sure you cant send something from Airtable that is not in Airtable itself.
Cant you just add attachment field to the base with the required PDF? That would be easy solution to your problem i guess
There might be some more complicated solutions involving scripting or possible some other workarounds, but I will leave that to member of this forum who are more experienced with coding.
Nov 12, 2020 03:10 AM
Thanks for your help. I am trying your idea but it is still quite complicated.
Here I am :
and not the file himself…
Do you have any idea about how to solve this ?
Thanks a lot !
Franck
Nov 12, 2020 06:32 AM
There are at least two things wrong with this statement:
This process doesn’t actually import anything into the record. Instead, it is either being attached (in which case it creates a new attachment link) OR the attachment link from the source table where it was originally attached is being copied. In either case, the file itself (a binary image in this case) does not exist in the record. File attachments in Airtable records are by reference (i.e., links); not by value (i.e., actual files).
As you point out, copying file references from one table into another upon creation of a new record achieves nothing except, it makes a new attachment (by reference) which ultimately makes a copy of the original file in your Airtable account, a process that – over time – will erode the storage quota of your Airtable account needlessly.
Ergo, this is an attachment “by reference”, not “by value”.
This is the prime directive of your requirements - an email with [one of] the designated attached files. Before discussing the best approach to achieve this requirement, let’s understand how Gmail works with links and actual attachments.
Despite the recommendation to import the three documents into Airtable, it leaves you with only a URL to work with and this fails the prime directive.
Document URLs placed into Gmail do not automatically cause the referenced file to be “attached” by value. They just become links in the email body.
There is one – and only one – exception to the second bullet point; if the URL points to a Google Drive document that exists within the same gmail account used to create the email automation, said document will be linked (by reference) and also attached (by value).
One Approach
Store your three PDF documents in Google Drive; expose them as accessible to “Anyone with the link…”.
Determine the direct URLs to each of the three documents such that they can be directly downloaded.
Modify your action process to chose which of the three Google Drive documents should be included in the email and embed such directly downloadable URLs into the email message.
Ensure that the Gmail account authenticated for the action process uses the same Google account where the three documents are stored.
Emails dispatched with this configuration should include both the link to the document and the document attached to the email message. Note, it is possible to conceal the long Google Drive URL in the message by using a little HTML so that your messages are prettier - this will not impact the ability of Gmail to perform the attachment.
Nov 13, 2020 01:11 AM
Thank you so much this is the perfect solution, you made it way more clear for me.
Best
Franck