Currently, the Mail function in JSL allows you to send email to a list of valid email addresses, however, it does so by incrementing through the list and sending an individual email to each recipient. On a machine where the email client requires user intervention to allow an email to be sent by JMP (e.g. Outlook on Windows in a corporate environment), this means that the user must sit and await a warning message for each recipient, sometimes with a built-in delay! This is highly inefficient, and means that sending out a report to interested stakeholders requires just as much if not more time when automated using the Mail function as it would to just manually copy and paste the report into an email.
JMP Version 16.2.0
Example code (assumes reports saved in temp folder as pngs, uses dummy email addresses):
sites = {"Site-1", "Site-2"};
report_path = Convert File Path( "$TEMP" );
default_dn = "example.com";
maillist = Associative Array(
sites,
{{// Site-1
"support@example.com", "stakeholder1@example.com", "stakeholder2@example.com", "stakeholder3@example.com"},
{// Site-2
"support@example.com", "stakeholder3@example.com", "vpsales@example.com"}}
);
For( i = 1, i <= N Items( sites ), i++,
site = sites[i];
rep_title = Eval Insert( "^site^_Report" );
temp_file_path = Convert File Path( report_path || "/" || rep_title || ".png" );
winmail = New Window( Eval Insert( "Send ^site^ Email" ),
V List Box(
Lineup Box( N Col( 2 ),
Text Box( "To:" ),
H List Box(
lb_to = List Box( maillist[site], <<NLINES> 0,
newl = lb_to << Get Items;
For( i = N Items( newl ), i > 0, i--,
If( Contains( seli, i ),
Remove From( newl, i )
)
);
lb_to << Set Items( newl );
);
)
)
),
Text Box( "Subject:" ),
teb_subj = Text Edit Box( rep_title ),
Text Box( "Body:" ),
teb_body = Text Edit Box(
Eval Insert( "Hello All,\!N\!tPlease find ^rep_title^ attached.\!N\!N" ),
<<SETNLINES></SETNLINES></NLINES>Hi @gob0b, thank you for your suggestion! We have captured your request and will take it under consideration.
@gob0b thanks for the input on the Mail function. We are investigating this and will follow up when we have more information to share.
Agree this is a deal breaker for using the email function for many users!! It would be great to roll this into the request from this item Send the chart with alarm script directly - JMP User Community
and make the email functions super useful!
With the python connectivity in JMP 19, a workaround is to have JMP launch a python script that handles the e-mail.
Python Submit File( "send_email.py" );<BR />
Where send_email.py is a python script in the same directory.