How to Add Download Link to Email

  • 1
  • 1
  • Question
  • Updated 7 months ago
  • Answered
Hi,
I am trying to add a download link to an email that gets generated automatically via button on a form. Basically, when a job has been reviewed, it needs to be sent to the supervisor to be approved along with the sketch of the job. Since the sketch itself(which is a file attachment field in the form) can't actually be attached as far as I know, I am trying to add a Download Link at the end of the email and the person approving the job can access the sketch immediately through the link.

I am able to get the button and email generation to work but don't know how to generate the link. 

Other Parameters: 
---the person approving the job is a quickbase user with access
---the field "Record ID#" has been deleted and the new key field is [WR #]
---there are two file attachment fields that could have the sketch. I need to send the link for the field [Sketch] if the field [Updated Sketch] is blank


Here is a copy of my current code working within a URL - Formula field:
---------------------------------------------------------------------------------------
var text URLONE = "MailTo:someone@someplace.com"

//&"?cc=user2@domain.com; user3@domain.com; user4@domain.com" (in case I add a CC in the future

&"&subject=WR for Approval"
&"&body=WR "&[WR #] &" is ready for approval."&"%0A%0A";


$URLONE
---------------------------------------------------------------------------------------

Any help is appreciated!



Photo of Jordan McAlister

Jordan McAlister

  • 1,460 Points 1k badge 2x thumb

Posted 7 months ago

  • 1
  • 1
Photo of QuickBasePros (Laura Thacker)

QuickBasePros (Laura Thacker), Champion

  • 5,466 Points 5k badge 2x thumb
Last year, Quick Base added a checkbox feature that will allow file attachments to be read via an email (downloaded) without having to log into Quick Base.  You simply need to encode the File Attachment field into your email notification.

Go into the File Attachment Field and check the box to
Allow Open Access [ ] Allow access to this file attachment from a Quick Base link without signing in



Since your email is being sent to Users; why do you not build a custom email notification and have users "trigger" that notification via Quick Base; rather than building a separate email-generating formula.
(Edited)
Photo of Jordan McAlister

Jordan McAlister

  • 1,460 Points 1k badge 2x thumb
If there are multiple reviewers would they all have to have this same exact email notification setup? I don't want the Sender to be "notify@quickbase.com." I just need to know how to reference the link to the attachment. Even referencing the record URL is fine except most posts I've seen involve referencing the [Record ID#] field, but ours has been deleted. I know each record I pull up has one because I can see it in the URL but I don't know how to reference it in the code if its not an official "field" anymore.

Photo of QuickBasePros (Laura Thacker)

QuickBasePros (Laura Thacker), Champion

  • 5,466 Points 5k badge 2x thumb
I got this to work (thanks to an old Mark Shnier post).  Even though you are using a custom key field; because the RID is still unique; you still use it in this formula-format.  I changed my test-table key field to a text field; and the link still worked.  You can probably play around with it to hide the URL with a cover text.  Also, your [Record ID#] might have been renamed; but it is a built-in field and cannot be deleted.  Sort your Field List by field ID# and look for the field numbered 3 to find out what it has been renamed.



"<a href=\"MailTo:lhquickbase@gmail.com"
&"?subject=Quick Specials Order"
&"&body=Attention SHNIER Customer Service, please order the following for me "

&"%0A%0A" & "My name is :______________________"
&"%0A%0A" & "My Purchase Order is:______________________"
&"%0A%0A" & "Special Instructions:______________________"
&"%0A%0A" & "My Store name is :______________________"
&"%0A%0A" & "My Tel number is :______________________"

&"%0A%0A" & "here is a link to the inventory record in Quick Specials"

&"%0A" &"https://laurahillier.quickbase.com/up/" & Dbid() & "/a/r" & [Record ID#] & "/e9/v0"

&"\">"&"Order by Email"&"</a>"

Additional Notes:
** field type = formula rich text **
** e9 ** - where 9 is the Field ID# of the file attachment field.

You can probably play some more with the encoded URL to cover the URL with a link text.

(Edited)
Photo of Jordan McAlister

Jordan McAlister

  • 1,460 Points 1k badge 2x thumb

I have verified that the link works using fields other than [Record ID#] which of course leads me to a missing WR # error, but when I try to use the RID I can't because the field [Record ID#] was deleted when this table was made(which I was not there for), so the RID technically exists but not as an actual reference-able field able to be used in brackets. Is there perhaps a way I can recover this field, so I can use it here?

the red error text says, "Field [Record ID#] is not identified"

Here's my exact code as well:
------------------------------------------------------------------------------------------
var text URLONE = "MailTo:someone@someplace.com"


//&"?cc=user2@domain.com; user3@domain.com; user4@domain.com"


&"&subject=WR for Approval"
&"&body=WR "&[WR #] &" is ready for approval."&"%0A%0A" &"%0A" &"https://pike.quickbase.com/up/"; & Dbid() & "/a/r" & [Record ID#] & "/e71/v0";


$URLONE

-------------------------------------------------------------------------------------------

Photo of QuickBasePros (Laura Thacker)

QuickBasePros (Laura Thacker), Champion

  • 5,466 Points 5k badge 2x thumb
All your error means is that field ID# 3 is not called [Record ID#].  Search for it in your field list first to identify the correct name of it.  It DOES exist, I promise you.
Photo of Jordan McAlister

Jordan McAlister

  • 1,460 Points 1k badge 2x thumb

You were right! Someone just renamed it in the beginning and wasn't even on any forms or formulas anywhere, it is working great now - thanks for your help!
Photo of Jordan McAlister

Jordan McAlister

  • 1,460 Points 1k badge 2x thumb

Sorry, I didn't even notice the last part of your post where you said it might have been renamed and still has field ID# 3; I guess I just started examining your code.