I'm trying to use JSL to send emails as part of a data retrieval query. How do I embed a data table or Journal table into the body of my text message?
Thanks
Hi @lou,
I did a search for Mail in the Scripting Index and found this:
Names Default To Here( 1 ); Mail( "test@example.com", "revelation", "JMP is great.", "$SAMPLE_DATA/Big Class.jmp" );
I tested it out with the Alarm Script example and it send me a message. I did not attach any JMP file, and not sure if it will embedd in the email body, but it will at least offer to add an attachment. Should solve your problem.
Hope this helps!,
DS
Hi DS,
Thanks for your reply. Attaching is an alternative. Still looking for a way to add this to the main message, whether by table, journal or picture.
Lou
This was a great challenge, and I think I figured it out. Should be only about three lines of code.
Names Default To Here( 1 ); dt = Data Table( "My Data Table" ); //this defines whichever data table you're dealing with tb=dt<<Get As Report(); //this generates a data table report Mail("myemail@address.com", "subject", "The data is " || Eval(tb<<Get Text)); //Using the Get text command generates a list, i.e. {"..."} which can be evaluated in the Mail command because it has quotes around it
I tested it on a data table of mine and it worked great. It even puts the text in a data table style/format. It is just text, but this should solve the original problem.
UPDATE: I went back and tested if you could add more text to the body and you can if you wrap the <<Get Text portion in an Eval() statement and concatenate with ||. So, I think this can get more advanced and "complicated" by concatenating several Eval() portions, depending on the complexity of the automated script.
Thank you very much!! This is what I needed! I appreciate your help.
Is it possible to to send picture in the email body (not attachment) and at the same time attach a table? The Eval () and get text not working for picture