1 of 1 people found this helpful
Just exporting records and then sending an email doesn't put anything in the body of the email. You need to put the text of the fields into the body of the email. You can use a calculation to do this. As an example:
"Dear " & table::firstName & ":¶¶" &
"Thank you for your purchase of " & table::productName & ". We appreciate your business. This is your invoice.¶¶" &
List ( product::productName ) & "¶" &
"Total: $" & invoice::total & "¶¶" &
"Please do not hesitate to call if you have any questions."
Obviously, you would use your own statement.
If you want to send an actual attachment, then you would attach the exported records (although a Save as PDF is probably more to the point). However, you'll want to be sure you save it to a consistent path using Get ( TemporaryPath ) or Get ( DocumentsPath ) and then attach it using the Attachment checkbox in the email dialog.
This works. I am not sure what drives the required saving of the file and the extra mail draft; however. If you have any feedback on that, please let me know. I thought Export Records [no dialog] would prevent that.
I'm not certain what you mean by "the required saving of the file". If all you want to do is send an email, there's no file saving required. Just construct the body of the email in the Body field and send it. (In other words, the Export Records step in your original script isn't needed.)
If you want to send an attachment, then, of course, you would need to create that file first. But that's not "extra"; it's just a requirement of sending an attachment. Can't send something that doesn't exist.
I realized that shortly after asking. The solution came out great. I will have to learn some more advanced scripting in the future, but this fits my current needs.