[Bio] / IGSBPortal / scripts / send_request_id.pl Repository:
ViewVC logotype

View of /IGSBPortal/scripts/send_request_id.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (download) (as text) (annotate)
Tue Jul 6 17:05:45 2010 UTC (9 years, 5 months ago) by wilke
Branch: MAIN
CVS Tags: HEAD
*** empty log message ***

#!/usr/bin/env perl

use strict;
use warnings;

use Getopt::Long;
use Data::Dumper;
use Mail::Mailer;

use IGSBportal::IGSBDB;




  

# read in parameters

my $status            = 'new';       
my $verbose           = 0 ;
my $send_notification = 0;
my $debug             = 0;
my $send_status       = "notification_send" ;

GetOptions ( 'status=s'  => \$status ,
	     'verbose'   => \$verbose ,
	     'send_mail' => \$send_notification,
	     'debug'     => \$debug,
           );


print STDERR "Getting IGSBDB object\n" if ($debug);
 my $igsb = IGSBportal::IGSBDB->new();

print STDERR "Getting list for $status\n" if ($debug);
my $list = $igsb->get_requests_by_status($status);

print STDERR Dumper $list , "\n" if ($debug);


my $text4mail = '
';


foreach my $r  (@$list){
  print join "\t" , $r->ID , $r->current_status , $r->ltime  , "\n" if ($verbose);
  print join "\t" , @{ $r->status_history } , "\n" if ($verbose);
  my $send = 0 ;
  foreach my $status  (@{ $r->status_history }){
    $send = 1 if ($status =~/$send_status/) 
  }

  unless ($send){
    &send_notification($r) ;
  }

  
}



sub send_notification{
  my ($request) = @_ ;
  
  my $to_local = 'wilke@mcs.anl.gov mdomanus@anl.gov mendez@mcs.anl.gov';
  # print "Sending email\n";

  # my $text4mail .= "http://hgac.igsb.org/igsb.cgi?page=ManageOffers&request=".$request->ID." \t " . $request->ID . "\t" . $request->current_status . "\t" . $request->ltime . "\n";
  
  my $text4mail  = "Your request has been submitted to IGSB Services with your request ID (R". $request->ID .").\n" ;

  $text4mail .="\nFor sample tracking and result distribution purposes, before shipping samples, please enter sample names and any desired experimental information into the following URL along with the core lab request ID provided above.\n
Cistrack database URL:
http://www.cistrack.org:8080/HGAC/app?scrid=".$request->ID."


Shipping

 Samples can be in water or TE. Samples can be shipped in a 1.5mL labeled tube, microtiter plate, or boxed. Samples and containers must be clearly labeled. If submitting unboxed, 1.5mL tubes sample tubes can be sealed with parafilm, placed in a 50mL screw-top falcon tube packed with KimWipe, and shipped frozen on dry ice. Please include plenty of dry ice with your samples. Please include concentration (fluorometry (Qubit) based preferred) for each submitted sample. Please avoid shipping out on Friday.

Shipping address:

ATTN: IGSB HGAC Lab
Argonne National Laboratory
9700 South Cass Avenue
Building 202 Room A346
Argonne, IL 60439-4803
Phone: (630) 252-3993

";
  # send mail

  my $to = join " " , $request->get_all_email , "\n" ; 



  my $mailer = Mail::Mailer->new();
  $mailer->open({ From    => 'sequencing@igsb.anl.gov',
		  To      => $to , 
		  Bcc     => 'wilke@mcs.anl.gov' ,
		  Subject =>  "Your IGSB-HGAC Request ID" ,
		}) or die "Can't open Mail::Mailer: $!\n";
  print $mailer $text4mail ;
  $mailer->close() or die "couldn't send whole message: $!\n";

  
  $mailer = Mail::Mailer->new();
  $mailer->open({ From    => 'sequencing@igsb.anl.gov',
		  To      => $to_local , 
		  Subject =>  "Your IGSB-HGAC Request ID" ,
		}) or die "Can't open Mail::Mailer: $!\n";
  print $mailer $text4mail ;
  $mailer->close() or die "couldn't send whole message: $!\n";


  push  @{ $request->status_history } , $send_status ;
  
}

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3