Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 6601 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

The database in question will have contacts with email addresses, and then also a series of documents stored in a separate table, in a container field. The user will basically select a contact, and then also select one or more documents. (The reality is much more complicated than that, but that's the essence of it.)

What I need to do is then script the sending of an email. The user will choose a template for the text of the email. Then the db must attach all of the documents selected from the Documents table.

Other requirements:

* the docs will be of various types (word, pdf, image, etc.)

* the docs must retain their original filenames

Is this possible to do without a plugin? The Send Email script step (in 8 advanced) doesn't seem to be able to accept a calculation for the Attachments parameter, although it will for pretty much everything else (addresse(s), title, text, etc.)

I'm open to using a plugin if necessary. If so, what's the best one to use here? Scriptability is paramount.

It doesn't matter so much whether the email is sent directly from FMP to SMTP server or via an email client like Outlook, etc., as long as the attachments get attached.

Thanks!

Posted

If you have the container field storing the file as a reference, then you can use the GetAsText (container_field) function to get the path info. Then after parsing out the data that you need, you can set it to a variable and under the mailing option, set up the attachment path to be that variable.

Posted (edited)

This almost works, and got me a lot farther than I thought it might. I had no idea I could include a variable in the Attachment parameter of the Send Email script step.

But I'm running up against the following limitations:

1. I can't get it to attach multiple documents in this way. I pass it two filenames on two different lines using 2 different variables, as in:

file:$attach1

file:$attach2

but it only ends up with the first attachment.

2. It doesn't really work with embedded attachments, which is what I'll have for this project. If the container just stores a path reference to the file, no problem. But if it's embedded, there's two problems:

* It only seems to attach the file at all if it happens to be in the same directory as the currently-open .fp7 file. (Have no idea how this would work if I had a hosted file open.)

* It's not attaching the version of the file stored in the database, but rather the version sitting in the filesystem.

So in effect what it's doing is:

* Look to see if there happens to be a file in the "default" directory with the same name as the one stored in the container field. If so, attach that one. If not, attach nothing.

This isn't going to work for me. Any way to improve this in native FMP, or am I back to looking at plugins?

My MAPI app is Eudora 7 on WinXP, if that makes any difference. I'm guessing it doesn't but please clue me in if I'm wrong about that.

Thanks!

Edited by Guest
Posted

Thanks, John.

Can anyone speak to whether mail.it or SMTPit or any of the other plugins will do the trick for me?

The thing that's hard to tell from the discriptions on their websites is how scriptable all of the plugin functionality is. I know it can do multiple attachments from container fields. But can I script that? And can I add multiple attachments from different records? Etc.

If anyone with experience with one or more email plugins (or plugin developers) could share their knowledge, it would be much appreciated.

Thanks!

This topic is 6601 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.