#!/usr/local/bin/perl require '/usr/home/fso/libs/fso-g-lib.pl'; require '/usr/home/em/libs/em-defs.pl'; require '/usr/home/em/libs/em-g-lib.pl'; use Date::Manip; use File::Copy; $lyris::config_filename = "/opt/lyris/cgi/lyris.plc"; my $rc = &lyris::init; use rlib '../../../mod-lib'; use di; my $dntk = new dntk; $| = 1; $DEBUG = 1; $N_DATE = &UnixDate('today', '%m-%d-%Y'); # MMDDYY # for ad tag... $timestamp = &UnixDate('today', '%Y%m%d%H%M%S'); # TOP_DIR hack $TOP_DIR = "$TOP_DIR/dr"; $LIST = "dr-html"; $CONTENT = "$TOP_DIR/bank/content"; $REPLYTO = "dr-html-reply\@DailyInbox.com"; $OURMAIL = "dr-html\@DailyInbox.com"; $SUBJECT = "DailyInbox.com - Daily Reflections - $N_DATE"; open (OUT, ">> /opt/zing_send.log"); print OUT "-> -------------------------------------------------\n"; print OUT "-> Starting: " . &UnixDate('today', "%Y-%m-%d %H:%M:%S") . "\n"; # TOP_DIR hack my $number = &getcount("$TOP_DIR/bank"); print OUT "-> Zing number: $number \n"; open (NUM, "< $TOP_DIR/bank/number.txt"); $number = ; chop($number); close NUM; open(IN, "<$CONTENT/${number}.html") or die("EM - $LIST - couldn't open content file [$CONTENT/${number}.html]"); @LINES = ; print "-> Successfully retrieved [$CONTENT/${number}.html] content for send.\n"; my ($lline, $prov_body); open (DAILY, "> $TOP_DIR/daily.html"); foreach $lline (@LINES) { print DAILY $lline; $prov_body .= $lline; } #print "$prov_body"; #exit; $SUBJECT = "DailyInbox.com - Daily Reflections - $N_DATE"; my $index = ''; # jim's version of SSI... open (INDEX, "< $TOP_DIR/template.html"); my @file = ; foreach $line (@file) { if ( $line =~ /timestamp/ ) { $line =~ s/timestamp/$timestamp/g; } if ( $line =~ /daily.html/ ) { $bbody .= "$prov_body"; #$index .= "$prov_body"; } if ( $line =~ /simpletop.html/ ) { open (STOP, "< $TOP_DIR/simpletop.html"); my @slurp = ; foreach $what (@slurp) { $bbody .= $what; #$index .= $what; } } if ( $line =~ /ad.html/ ) { $bbody .= $ad_text; #$index .= $ad_text; } if ( $line =~ /Your E-Mail Address:/ ) { $bbody .= ""; } else { $bbody .= "$line"; $index .= "$line"; } if ( $line =~ /subinfo.txt/ ) { open (STOP, "< $TOP_DIR/subinfo.txt"); my @slurp = ; $bbody .+ "\n\n"; foreach $what (@slurp) { $bbody .= $what; } } } my $ab = &insert_ads($index, $dntk, $AD_DATE, 'dr-html'); open (INDEX, ">${TOP_DIR}/index.shtml"); print INDEX $ab; close INDEX; my $ad_body = &insert_ads($bbody, $dntk, $AD_DATE, 'dr-html'); my $bbody = $ad_body; ################ #print $bbody; #exit; ################ $mid = &sendLyrisMail("dr-html", "$SUBJECT", "$REPLYTO", "$OURMAIL", "$bbody", "html", "$LIST.html"); #$mid = &sendLyrisMail("dr-test-html", "TEST - $SUBJECT", "$REPLYTO", "$OURMAIL", "$bbody", "html", "$LIST.html"); #exit; print LOG "-> Message id: [$mid]\n"; if ( ! $mid ) { print LOG "-> ERROR: Message inject into lyris for $LIST has failed! [$mid]\n"; `/usr/local/bin/critsit "HTML $LIST [$mid] message into Lyris failed!"`; exit; } my $new_num = &increment("$TOP_DIR/bank"); print OUT "-> YES incrementing the from [$number] to [$new_num]\n"; print LOG "-> Message inject successful NOT updating [$NUMBER_FILE].\n"; print LOG "-> Done.\n\n"; exit;