it looks like Andy is too busy to see this:
can you take a look at SendEmailAfterAdd.pm
and tell me what changes needed to fix this:
# ==================================================================
# Plugins::SendEmailAfterAdd - Auto Generated Program Module
#
# Plugins::SendEmailAfterAdd
# Author : Andy Newby (Ultranerds)
# Version : 1
# Updated : Tue Feb 15 08:29:24 2005
#
# ==================================================================
#
package Plugins::SendEmailAfterAdd;
# ==================================================================
use strict;
use GT::Base;
use GT::Plugins qw/STOP CONTINUE/;
use Links qw/$CFG $IN $DB $USER/;
use GT::Template;
# Inherit from base class for debug and error methods
@Plugins::SendEmailAfterAdd::ISA = qw(GT::Base);
# Your code begins here! Good Luck!
# PLUGIN HOOKS
# ===================================================================
sub user_add_link {
# -----------------------------------------------------------------------------
# This subroutine will be called whenever the hook 'user_add_link' is run. You
# should call GT::Plugins->action(STOP) if you don't want the regular
# 'user_add_link' code to run, otherwise the code will continue as normal.
#
my (@args) = @_;
my $newIN;
%$newIN = map { $_ => $IN->param($_) } $IN->param;
$newIN->{ID} = $DB->table('CatLinks')->select( ['MAX(LinkID)'] )->fetchrow;
$newIN->{Category} = get_cat($IN->param('CatLinks.CategoryID'));
my $message = GT::Template->parse( 'add-email-pre.txt', { %$newIN, %$USER, %$CFG }, { compress => 0 } );
my $support_email = $CFG->{db_admin_email};
my $subject = "AICCSA 2007 Submission Received...";
require GT::Mail;
$GT::Mail::error ||= ''; # Silence -w
GT::Mail->send (
smtp => $CFG->{db_smtp_server},
sendmail => $CFG->{db_mail_path},
from => $support_email,
subject => $subject,
to => $IN->param('Contact_Email'),
msg => $message,
debug => $Links::DEBUG
) or Links::fatal ("Unable to send mail: $GT::Mail::error");
return @args;
}
sub get_cat {
my $catid = $_[0];
my $cat = $DB->table('Category')->get($catid);
return $cat->{Full_Name};
}
# Always end with a 1.
1;
can you take a look at SendEmailAfterAdd.pm
and tell me what changes needed to fix this:
# ==================================================================
# Plugins::SendEmailAfterAdd - Auto Generated Program Module
#
# Plugins::SendEmailAfterAdd
# Author : Andy Newby (Ultranerds)
# Version : 1
# Updated : Tue Feb 15 08:29:24 2005
#
# ==================================================================
#
package Plugins::SendEmailAfterAdd;
# ==================================================================
use strict;
use GT::Base;
use GT::Plugins qw/STOP CONTINUE/;
use Links qw/$CFG $IN $DB $USER/;
use GT::Template;
# Inherit from base class for debug and error methods
@Plugins::SendEmailAfterAdd::ISA = qw(GT::Base);
# Your code begins here! Good Luck!
# PLUGIN HOOKS
# ===================================================================
sub user_add_link {
# -----------------------------------------------------------------------------
# This subroutine will be called whenever the hook 'user_add_link' is run. You
# should call GT::Plugins->action(STOP) if you don't want the regular
# 'user_add_link' code to run, otherwise the code will continue as normal.
#
my (@args) = @_;
my $newIN;
%$newIN = map { $_ => $IN->param($_) } $IN->param;
$newIN->{ID} = $DB->table('CatLinks')->select( ['MAX(LinkID)'] )->fetchrow;
$newIN->{Category} = get_cat($IN->param('CatLinks.CategoryID'));
my $message = GT::Template->parse( 'add-email-pre.txt', { %$newIN, %$USER, %$CFG }, { compress => 0 } );
my $support_email = $CFG->{db_admin_email};
my $subject = "AICCSA 2007 Submission Received...";
require GT::Mail;
$GT::Mail::error ||= ''; # Silence -w
GT::Mail->send (
smtp => $CFG->{db_smtp_server},
sendmail => $CFG->{db_mail_path},
from => $support_email,
subject => $subject,
to => $IN->param('Contact_Email'),
msg => $message,
debug => $Links::DEBUG
) or Links::fatal ("Unable to send mail: $GT::Mail::error");
return @args;
}
sub get_cat {
my $catid = $_[0];
my $cat = $DB->table('Category')->get($catid);
return $cat->{Full_Name};
}
# Always end with a 1.
1;