October 25, 20169 yr Hello, New to the Email Plug in and testing how to send an email with HTML formatting and inline attachments. I'm trying to follow the example pretty closely, but every time I run it, it generates an error, "data parameter may not be empty", but I think I have every parameter filled out. Here's the sample script: Let ( [ $File1 = AwardsEmails::AwardEMail_AttachmentFilename1; $File2 = AwardsEmails::AwardEMail_AttachmentFilename2 ]; EmailCreate("[email protected]"; "[email protected]"; AwardsEmails::AwardEMail_Subject) and EmailSetBody(AwardsEmails::AwardEMail_Message_calc; "html" ) and If($File1 ≠ ""; EmailAttachFileInline( AwardsEmails::AwardEMail_AttachmentPathFolder ; $File1)) and If($File2 ≠ ""; EmailAttachFileInline( AwardsEmails::AwardEMail_AttachmentPathFolder ; $File2)) and EmailSend ) All the fields have text content. The Message_calc field contains the following: <html><body><img src="cid:logopng"> This is a test that we are sending in bold, underline, and italic to all members of the test group, showing what an html file could look like. Thanks. New Awards <img src="cid:LogoJRBIpng"></body></html> Can anyone please tell me what parameter I might be missing? Thanks! MB
October 25, 20169 yr Hi- Are the filenames that you get in your let statement equal to the cids you are creating in your HTML? As in, does $File1 == "logopng" or "LoglJRBIpng"? If that is the case, then it might be helpful to check the plugin log files. You will need to replicate the issue and then get the logs without restarting Filemaker. Locations for log files can be found here. Thanks!
October 25, 20169 yr Author Hi, Thanks for the help. Yes, the filenames are the same as the cids (the are generated automatically from the field). Running the script again, it showed that it could not identify where the file was. I played around (I had the path set as in my applescripts, using : and not / as separators. So I changed the directory path by adding "filemac:/" the directory (with /), and it does not complain about not finding the file, but it gives me a different error (java.lang.NullPointerException): Quote SEVERE: PluginFunction PluginFunction{name='EmailAttachFileInline', functionID=-5878, minArgs=null, maxArgs=2} got an error with converted args [com.prosc.fmkit.types.FMData@173a64a, logopng] java.lang.NullPointerException at com.prosc.emailplugin.EmailerPlugin.EmailAttachFileInline(EmailerPlugin.java:701) at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Method.java:597) at com.prosc.fmkit.StaticFunction.invoke(StaticFunction.java:231) at com.prosc.fmkit.Plugin.invokeFunction(Plugin.java:352) at com.prosc.fmkit.RegisterablePlugin.invokeFunction(RegisterablePlugin.java:170) at com.prosc.fmkit.Plugin.invokeFunctionNoErrors(Plugin.java:333) at com.prosc.fmkit.PluginBridge$4.run(PluginBridge.java:1203) at com.prosc.fmkit.PluginBridge.runTask(PluginBridge.java:1443) at com.prosc.fmkit.PluginBridge.doFunction(PluginBridge.java:1220) What might that be? Thanks for the help. By the way, sending plain emails works fine. MB
October 25, 20169 yr Does it work if you have the path set as "/path/to/file" ie "/Users/Ben/test.txt", without "filemac:" or anything prepended?
October 26, 20169 yr Author No, it does not work. I just tried it and it generates this error, which I don't understand. Quote Oct 26, 2016 9:15:23 AM com.prosc.fmkit.Plugin setLastError SEVERE: PluginFunction PluginFunction{name='EmailAttachFileInline', functionID=-5878, minArgs=null, maxArgs=2} got an error with converted args [com.prosc.fmkit.types.FMData@114025, Premioslogopng] java.lang.NullPointerException at com.prosc.emailplugin.EmailerPlugin.EmailAttachFileInline(EmailerPlugin.java:701) at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Method.java:597) at com.prosc.fmkit.StaticFunction.invoke(StaticFunction.java:231) at com.prosc.fmkit.Plugin.invokeFunction(Plugin.java:352) at com.prosc.fmkit.RegisterablePlugin.invokeFunction(RegisterablePlugin.java:170) at com.prosc.fmkit.Plugin.invokeFunctionNoErrors(Plugin.java:333) at com.prosc.fmkit.PluginBridge$4.run(PluginBridge.java:1203) at com.prosc.fmkit.PluginBridge.runTask(PluginBridge.java:1443) at com.prosc.fmkit.PluginBridge.doFunction(PluginBridge.java:1220) Oct 26, 2016 9:15:24 AM com.prosc.fmkit.PluginBridge$7 run INFO: Initialized AWT successfully from Thread[Thread-8,5,main] Thanks for the help! MB
October 26, 20169 yr Author I checked to see if the data in the function EmailAttachFileInline ( data ; contentId ) required not just the directory (since contentid provides the filename) and added it but I still got an error: Users/mbust/Documents/PremiosSubmittedDocs/logopng (No such file or directory). So thinking about it, and realizing that the problem had to do with finding the file, I thought about the file name. I know the file is there and it is named (in the Finder) just as it appears in the FM field. But what I had done, as per the instructions on the Documentation file ("You should only use letters and numbers for your content ids, some mail clients have trouble with other characters"), was to remove the period (dot) in the extension. But the extension is not really gone, is it? So I changed the name in FM by adding the extension (so now it is, for example, logopng.png instead of logopng). In the Finder, it still reads logopng, unless you ask for More Info which will show also the extension. Doing this solved the problem. The file was found and the email was sent! So there it is, all done! Now on to make the email formatting look good. Thanks for the help! I really appreciate it!!
Create an account or sign in to comment