I am using the Action Commands plugin to send emails from Octoprint
1/ When the print starts heating up the bed and head.
2/ when printing actually starts.
3/ when the print finishes.
I installed the sendEmail.pl smtp client script onto the Octoprint Raspeberry pi (sendEmail.pl is a pure Perl smtp client for sending email) it just needed a couple of extra perl modules adding (for SSL support) then it can be configured to send email via any smtp server you are using such as Gmail, etc.
I found it much easier to install and configure sendEmail.pl than any of the standard raspberry packages available for sending emails and as Octoprint already has Perl installed it was a natural fit.
I put three perl scripts on the raspberry pi which send the appropriate emails using the sendEmail.pl script. I configured the Action Commands plugin to call my scripts when certain action commands are encountered in the Gcode then added the M118 //action;dosomething; commands in the appropriate Slic3R (my slicer software) custom gcode sections.This works nicely and generates Gcode files that will send these emails.
At the moment I just get emails saying essentially prepared, started, completed.
What I would like to do is have the action commands pass a parameter, probably the gcode filename to the script being called so it can use it in the the email messages, so the email can tell me what script is being prepared, started and completed. Is there a way of
1/ Obtaining the gcode filename at runtime in the the gcode program,
2/ Passing the value obtained as a parameter in the action command