JordanMcAlister
7 years agoQrew Captain
URL link as Image in Email?
I am trying to figure out how to show an image or at least change the text shown of a URL link that gets put into an email. Basically, I have a "Send for Approval" button on a form that automatically generates an email with the recipient, subject, and body filled in using "mailto:" and I put an "Approval" URL link in there that uses my authentication information to sign in and change three separate fields in the form then automatically logs out and redirects to the logged out page. So far, this is working, except, I don't want the link to show. I want either text that says, "Approve this job" or some image over it that has the hyperlink, and I would rather not use the email notification feature for this, considering I would like the "From" in the email be the user who clicked the button and we already use this button minus the "Approve" link in the email. The approver right now has to send a reply back saying it has been approved then the user has to go back into quickbase and change the three fields him/herself.
All of this was done in steps, so each part of what this "Send for Approval" button does has been done incrementally as I figured out how to do each thing. Everything works except for the image/text for link replacement, but I figure I need to post all the code involved in the process, so, right now, I have three fields to try to accomplish this:
/Send for Approval
(the main button on the form and uses "/ApproveImage" as the link)
/Approve in email
(accomplishes the approval part of signing in, changing three fields, and logging out)
/ApproveImage
(tried using this field with html code using <href> and <img>, but it is still showing link.)
Here is my code:
/Send for Approval
=========================================================================
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" &"Below is the download link for the sketch:" & "%0A" &
If(
[Updated Sketch]="",
"h ttps://pike.quickbase.com/up/"; & Dbid() & "/a/r" & [Record ID#] & "/e71/v0",
"h ttps://pike.quickbase.com/up/"; & Dbid() & "/a/r" & [Record ID#] & "/e91/v0"
)
& "%0A%0A" & "To approve this job, click the link below:" & "%0A" & URLEncode([/ApproveImage])
;
$URLONE
=========================================================================
/Approve in email
=========================================================================
var text URLONE = "h t t p s://pike.quickbase.com/db/main?act=API_Authenticate&username=me@someplace.com&password=mypassword";
var text URLTWO = "h ttps://pike.quickbase.com/db/bmwn5ta2x";
& "?act=API_EditRecord&key=" & [WR #]
& "&_fid_77=" & ToText(Today())
& "&_fid_15=" & ToText(50)
& "&_fid_76=" & ToText("Name of Approver")
& "&_fid_136=" & true
&"&apptoken=****************************";
var text URLTHREE = "h ttps://pike.quickbase.com/db/main?a=API_SignOut";
var text URLFOUR = "h ttps://pike.quickbase.com/db/main?a=LogoutConfirm";
$URLONE
&
"&rdr=" & URLEncode($URLTWO) &
URLEncode("&rdr=" & URLEncode($URLTHREE)) &
URLEncode(URLEncode("&rdr=" & URLEncode($URLFOUR)))
=========================================================================
/ApproveImage
=========================================================================
"<a href=\"" & [/Approve in email]&"&\">"&
"<img src=\"h ttps://openclipart.org/download/312459/1545571884.svg\"></a"
//"<a href="&[/Approve in email]&">"&
//"<img src=\"h ttps://openclipart.org/download/312459/1545571884.svg\"></a>"
=========================================================================
In the /ApproveImage code, I have tried both of the instances of href/img and they just show the massive link and no image.
I appreciate any help on this!
All of this was done in steps, so each part of what this "Send for Approval" button does has been done incrementally as I figured out how to do each thing. Everything works except for the image/text for link replacement, but I figure I need to post all the code involved in the process, so, right now, I have three fields to try to accomplish this:
/Send for Approval
(the main button on the form and uses "/ApproveImage" as the link)
/Approve in email
(accomplishes the approval part of signing in, changing three fields, and logging out)
/ApproveImage
(tried using this field with html code using <href> and <img>, but it is still showing link.)
Here is my code:
/Send for Approval
=========================================================================
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" &"Below is the download link for the sketch:" & "%0A" &
If(
[Updated Sketch]="",
"h ttps://pike.quickbase.com/up/"; & Dbid() & "/a/r" & [Record ID#] & "/e71/v0",
"h ttps://pike.quickbase.com/up/"; & Dbid() & "/a/r" & [Record ID#] & "/e91/v0"
)
& "%0A%0A" & "To approve this job, click the link below:" & "%0A" & URLEncode([/ApproveImage])
;
$URLONE
=========================================================================
/Approve in email
=========================================================================
var text URLONE = "h t t p s://pike.quickbase.com/db/main?act=API_Authenticate&username=me@someplace.com&password=mypassword";
var text URLTWO = "h ttps://pike.quickbase.com/db/bmwn5ta2x";
& "?act=API_EditRecord&key=" & [WR #]
& "&_fid_77=" & ToText(Today())
& "&_fid_15=" & ToText(50)
& "&_fid_76=" & ToText("Name of Approver")
& "&_fid_136=" & true
&"&apptoken=****************************";
var text URLTHREE = "h ttps://pike.quickbase.com/db/main?a=API_SignOut";
var text URLFOUR = "h ttps://pike.quickbase.com/db/main?a=LogoutConfirm";
$URLONE
&
"&rdr=" & URLEncode($URLTWO) &
URLEncode("&rdr=" & URLEncode($URLTHREE)) &
URLEncode(URLEncode("&rdr=" & URLEncode($URLFOUR)))
=========================================================================
/ApproveImage
=========================================================================
"<a href=\"" & [/Approve in email]&"&\">"&
"<img src=\"h ttps://openclipart.org/download/312459/1545571884.svg\"></a"
//"<a href="&[/Approve in email]&">"&
//"<img src=\"h ttps://openclipart.org/download/312459/1545571884.svg\"></a>"
=========================================================================
In the /ApproveImage code, I have tried both of the instances of href/img and they just show the massive link and no image.
I appreciate any help on this!