Forum Discussion

JordanMcAlister's avatar
JordanMcAlister
Qrew Captain
6 years ago

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!

12 Replies

  • I have not tested this in a mail to command b ut here is a generic format of a hyperlink

    var text Words= "Your words go here";
    var text URL = "Your URL goes here";

    "<a href=" & $URL & ">" & $Words & "</a>"
    Let me know if that works in a mailto:
  • It didn't work; it just shows <a href=".......url...../a>.  I am using a "Formula - Text" field for the /ApproveImage. Should I be using Rich Text field?

    Here is my update code for /ApproveImage:
    ============================================================================
    var text Words= "Approve Job";
    var text URL = [/Approve in email];


    "<a href=" & $URL & ">" & $Words & "</a>"
    ============================================================================
  • Can you tell me what your email client is?  outlook?  Gmail?  what email program do you use?

  • is there a button in your Outlook to change the screen to Rich Text  under 

    "format text"


  • yes, it gives me "html, plain text, and rich text." There is also, in option - under Mail, a place where I can choose the same options when composing messages.

  • As I have not tested, does that change the result if you select those other options.
  • it does not, I tried while in the compose message editor then I even tried changing it in options and restarted outlook and still nothing.
  • I will have to find time to play with it myself when I get a chance see if I can coax into Rich text.