Next changeset 1:0b1cdae7ad5b (2013-05-08) |
Commit message:
You must edit the sender email in the perl script after installation! |
added:
sendmail.pl |
b |
diff -r 000000000000 -r ee7ea1c2d01a sendmail.pl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sendmail.pl Wed May 08 04:44:35 2013 -0400 |
b |
@@ -0,0 +1,53 @@ +#!/usr/bin/perl + +# load modules +use Getopt::Std; + +########################## +# COMMAND LINE ARGUMENTS # +########################## +# u = (u)ser email from galaxy +# s = subject +# a = sample (a)nnotation +# g = sample (g)ender +# o = (o)utput file (simple text file) +getopts('u:s:o:d:', \%opts); # option are in %opts + + +if (!exists($opts{'u'})) { + die('no email specified'); +} +$email = $opts{'u'}; + +if (exists($opts{'s'}) && $opts{'s'} ne '') { + $subject = $opts{'s'}; +} +else { + $subject = "Galaxy Workflow or Job Finished\n"; +} + +# first compose message. +open OUT, ">mail.txt"; +print OUT "to: $email\n"; +print OUT "subject: $subject\n"; +## EDIT THE FROM EMAIL !!! +print OUT "from: ADMIN\@Your.Galaxy.org\n\n"; +print OUT "Your Workflow on the Biomina Galaxy instance is finished. \n\n"; +#print OUT "Access the results at : http://143.169.238.104/galaxy/\n"; +if (exists($opts{'d'})) { + my @files = split(/@@@/,$opts{'d'}); + print OUT "\n\nThe following datasets needed to be available before sending this notice:\n"; + foreach (@files) { + $_ =~ s/^\s+//; + if ($_ eq '') { + next; + } + print OUT " - $_\n"; + } +} +print OUT "\n\nPlease clean up unneeded datafiles, including hidden files (select 'show hidden').\n"; +close OUT; +system("sendmail $email < mail.txt"); +system("rm -f mail.txt"); + + |