ensembl-hive
2.8.0
|
This RunnableDB module will send you a short notification email message per each job. You can either dataflow into it, or simply create standalone jobs. The main body of the email is expected in the "text" parameter. If the "is_html" parameter is set, the body is expected to be in HTML. Attachments such as diagrams, images, PDFs have to be listed in the 'attachments' parameter. format_table provides a simple method to stringify a table of data. If you need more options to control the separators, the alignment, etc, have a look at the very comprehensive Text::Table. Note: this module uses Email::Sender to send the email, which by default uses sendmail but has other backends configured. As such, it depends heavily on the implementation of your compute farm. Please make sure it works as intended before using this module in complex pipelines.
Definition at line 40 of file NotifyByEmail.pm.
public Bio::EnsEMBL::Hive::RunnableDB::NotifyByEmail::fetch_input | ( | ) |
Description : Implements fetch_input() interface method of Bio::EnsEMBL::Hive::Process that is used to read in parameters and load data. Here we have nothing to do.
public Bio::EnsEMBL::Hive::RunnableDB::NotifyByEmail::format_table | ( | ) |
The same type of table could be generated with Text::Table:
my $first_column_name = shift $columns; my $tb = Text::Table->new(\'| ', $first_column_name, (map { +(\' | ', $_) } $columns), \' |',); $tb->load($results); my $rule = $tb->rule('-', '+'); return $title . "\n" . $rule . $tb->title() . $rule . $tb->body() . $rule;
public Bio::EnsEMBL::Hive::RunnableDB::NotifyByEmail::param_defaults | ( | ) |
Undocumented method
public Bio::EnsEMBL::Hive::RunnableDB::NotifyByEmail::run | ( | ) |
Description : Implements run() interface method of Bio::EnsEMBL::Hive::Process that is used to perform the main bulk of the job (minus input and output). Here the actual sending of the email message happens in run() though one may argue it is technically 'output'.
param('email'): The email address to send the message to.
param('subject'): The (optional) 'Subject:' line.
param('text'): Text of the email message. It will undergo parameter substitution.
param('is_html'): Boolean. Whether the content of 'text' is in HTML
param('attachments'): Array of paths for files to attach.
param('*'): Any other parameters can be freely used for parameter substitution.
public Bio::EnsEMBL::Hive::RunnableDB::NotifyByEmail::write_output | ( | ) |
Description : Implements write_output() interface method of Bio::EnsEMBL::Hive::Process that is used to deal with job's output after the execution. Here we have nothing to do.