We help IT Professionals succeed at work.

How do you code a Filemaker SMTP email so that the folder path is a hyperlink?

rvfowler2
rvfowler2 asked
on
How do you code a Filemaker SMTP email so that the folder path is a hyperlink?
Comment
Watch Question

Will LovingPresident, Dedication Technologies, Inc.

Commented:
Do you mean the folder path for the attachment?

Author

Commented:
Yes, example below.  I want it to be a clickable hyperlink when my boss receives it in Outlook for FM's SMTP email script.

N:\EXCEL\Files\FMexports\Tenants\Tenant Aging Report.xlsx
Will LovingPresident, Dedication Technologies, Inc.

Commented:
To the best of my knowledge, FileMaker's attachment option is designed to send an actual attachment, a file not a link. Normally, if FileMaker's Send Mail function supported HTML, you should be able to do something like this in the body of the email, though some browsers put restrictions on linking to files for security reasons.

<a href="file://N:/EXCEL/Files/FMexports/Tenants/Tenant Aging Report.xlsx">Tenants Report</a>

You could try inserting this link - it will have to be carefully coded in your calculation and tested due to various exception characters like slashes and quotes - and see if Outlook recognizes it as a link.

One option would be to use the SMTPit Plugin (or similar) that support HTML text in emails.
https://www.cnsplug-ins.com/Plug-ins/SMTPit_Pro/

Another would be to use FileMaker's WebDirect functionality. Store the document in a Container field (with External Storage turned on) and include a URL to the file to download. This involves turning on WebDirect, which makes the FM Server a web server as well and it will not open the file in one click, but it will make the file accessible without physically sending it as an attachment.

Author

Commented:
Forwarded to myself until I got it to work in HTML.  FM may still send in plain text by default, but may get it to work if I can figure out how to have quotes left over before file and after xlsx.  How do you do the equivalent of double quotes so you still have quotes left that are included in the email?

<a href="file://N:/EXCEL/Files/FMexports/Tenants/Tenant Aging Report.xlsx">Tenants Report</a>
President, Dedication Technologies, Inc.
Commented:
There are several tricks to coding certain escape characters in FileMaker. One is to be aware of and use the escape character option when creating a calculation. The FileMaker escape character is a backslash, so if you want to include quotes in a text string, rather than having the calculation engine interpret it as the end of the string, you precede it with a backslash, e.g.

"\"Fred " & "and Jane\"" returns “Fred and Jane”.

Similarly, to have a backslash in a string, you need to put two backslashes, e.g.

"Hello \\ World" would return "Hello \ World"

https://community.filemaker.com/en/s/question/0D50H00006h9LAlSAM/backslash-in-quotation-marks-in-calculations

In addition, you might also use the Quote( text ) function which prevents the text from being evaluated, e.g.

Quote(“say \”hello\” fred”) returns “say \”hello\” fred”

https://fmhelp.filemaker.com/help/12/fmp/en/html/func_ref3.33.80.html

Author

Commented:
Thanks, that worked!