1. Create what you want the email to look like as a layout with the image and text.
2. Export as pdf.
3. Attach the pdf to the email.
That will give you what you want - but it will have the limitation of being in the pdf rather than directly in the body of the email.
Thanks, I have PDFs as another option, this is for sending jpegs when preferred.
So you want to send the jpeg? or you want the jpeg to appear in the body of the email? You can send the jpeg as an attachment, with the text in the body of the email.
Appearance of a mail is controlled by the user who received, not mail itself.
You can select something
1. use HTML containing both. Some users don't read it.
2. use PDF containing both. Usually need to open attachment.
3. simply attach image. Some users see it inline below the body text.
You already have AppleScript to send the email, so you just need to add functionality to this script to it to insert the exported image in the body of html.
Thanks, any ideas how to build something like that or where i could find it? I imagine it has to pull the image from a recent export to desktop or a temporary path location? as the user will have just chosen the image to export from the database.
This should be fairly straight forward.
Do you always use Apple Mail and it is always on a Mac?
Is it always from the desktop - no AppleScript support for iOS?
Do you need default text or email address inserted from the database?
Do you need to auto send generated email?
I can try to put something simple together, unless someone could post a link to already existing solution.
You other option, by the way, is to use one of the email plugins or web services.
That would be great! No email addresses inserted necessary, no auto send. I've looked at plug ins but never got on that well would like to keep simple if possible..
Ideally things happen as below -
- Selected image exports and is attached to an email (default email program or Mac Mail if necessary - I think that above script does that with Filemaker). The above attaches to an email with iOS so thats fine. 99% Mac users for my database.
- Copy text from field
- paste into body of email above or below attached jpeg
You can probably get away without using AppleScript, and instead just use the native FileMaker 'Send Mail' script step.
The email script would simply be something like:
Set Variable [ $path; Value:Get(TemporaryPath) & GetAsText ( artworks::image ) ]
Export Field Contents [ artworks::image; “$path” ]
Send Mail [ Send via E-mail Client; Subject: "My subject"; Message: List ( artworks::artist; artworks::title; artworks::medium; artworks::size; artworks::reference ); Attachment: “$path” ]
All it does is:
1. Set a $path variable to the TemporaryPath followed by it's stored file name.
2. Export the container field to that $path
3. Create new email with the file saved at $path as an attachment, and with body text calculated from field contents for that record.
See attached example....
emailer.fmp12.zip 184.5 K
Brilliant, thank you. For ages people have been saying only possible with a plugin. The next thing will be looping through a found set and attaching several images with their corresponding descriptions. Possible with a loop script do you think?
Ah, that would be more complicated... The native 'Send Mail' script step can only send one attachment.
For this you might be better off to create a PDF with the images and corresponding descriptions laid out as desired and export that for it to be attached to the email....
Otherwise, then yes, you would need to look at using plugins, or a web based service such as using the Mandrill API to create a full HTML email with the images and descriptions set out in it. The images could be base64 encoded so that they can be sent within the HTML...