converting to new mail queue api

This commit is contained in:
JT Smith 2006-03-21 03:36:44 +00:00
parent 7c71d93c1e
commit 47afbb0138
6 changed files with 13 additions and 13 deletions

View file

@ -648,9 +648,9 @@ sub sendEmail {
}
}
if ($to =~ /\@/) {
my $mail = WebGUI::Mail::Send->new($self->session,{to=>$to, subject=>$subject, cc=>$cc, from=>$from, bcc=>$bcc});
my $mail = WebGUI::Mail::Send->create($self->session,{to=>$to, subject=>$subject, cc=>$cc, from=>$from, bcc=>$bcc});
$mail->addText($message);
$mail->send;
$mail->queue;
} else {
my ($userId) = $self->session->db->quickArray("select userId from users where username=".$self->session->db->quote($to));
my $groupId;
@ -662,16 +662,16 @@ sub sendEmail {
$self->session->errorHandler->warn($self->getId.": Unable to send message, no user or group found.");
} else {
WebGUI::MessageLog::addEntry($userId, $groupId, $subject, $message, "", "", $from);
my $mail = WebGUI::Mail::Send->new($self->session,{to=>$cc, subject=>$subject, from=>$from});
my $mail = WebGUI::Mail::Send->create($self->session,{to=>$cc, subject=>$subject, from=>$from});
if ($cc) {
$mail->addText($message);
$mail->send;
$mail->queue;
}
if ($bcc) {
WebGUI::Mail::Send->new($self->session, {to=>$bcc, subject=>$subject, from=>$from});
WebGUI::Mail::Send->create($self->session, {to=>$bcc, subject=>$subject, from=>$from});
$mail->addText($message);
$mail->send;
$mail->queue;
}
}
}

View file

@ -993,9 +993,9 @@ sub www_viewDetail {
if ($self->session->form->process("do") eq "sendEmail") {
if ($self->session->form->process("body") ne "") {
my $u = WebGUI::User->new($self->session, $listing->{maintainerId});
my $mail = WebGUI::Mail::Send->new($self->session, {to=>$u->profileField("email"),subject=>$listing->{productName}." - ".$self->session->form->process("subject"),from=>$self->session->form->process("from")});
my $mail = WebGUI::Mail::Send->create($self->session, {to=>$u->profileField("email"),subject=>$listing->{productName}." - ".$self->session->form->process("subject"),from=>$self->session->form->process("from")});
$mail->addText($self->session->form->process("body"));
$mail->send;
$mail->queue;
}
$var{'email.wasSent'} = 1;
} else {

View file

@ -234,7 +234,7 @@ sub createAccountSave {
if ($self->session->setting->get("webguiValidateEmail")) {
my $key = $self->session->id->generate();
$self->saveParams($self->userId,"WebGUI",{emailValidationKey=>$key});
my $mail = WebGUI::Mail::Send->new($self->session,{
my $mail = WebGUI::Mail::Send->create($self->session,{
to=>$profile->{email},
subject=>$i18n->get('email address validation email subject','AuthWebGUI')
});

View file

@ -534,9 +534,9 @@ sub www_emailGroupSend {
on a.userId=b.userId and b.fieldName='email' where a.groupId=".$session->db->quote($session->form->process("gid")));
while (($email) = $sth->array) {
if ($email ne "") {
my $mail = WebGUI::Mail::Send->new($session, {to=>$email,subject=>$session->form->process("subject"),from=>$session->form->process("from")});
my $mail = WebGUI::Mail::Send->create($session, {to=>$email,subject=>$session->form->process("subject"),from=>$session->form->process("from")});
$mail->addHtml($session->form->process("message","HTMLArea"));
$mail->send;
$mail->queue;
}
}
$sth->finish;

View file

@ -94,7 +94,7 @@ sub execute {
$self->session->user({user=>$user});
my $message = $self->get("message");
WebGUI::Macro::process(\$message);
my $mail = WebGUI::Mail::Send->new($self->session, {
my $mail = WebGUI::Mail::Send->create($self->session, {
to=>$self->get("to"),
subject=>$self->get("subject")
});

View file

@ -125,7 +125,7 @@ sub execute {
$message .= "UNPROCESSED PAYMENTS:\n-----------------------------\n".join("\n", @unprocessed)."\n\n\n";
$message .= "FATAL ERRORS:\n-----------------------------\n".join("\n",@fatal)."\n\n\n";
$message .= "SUCCESFUL PAYMENTS:\n-----------------------------\n".join("\n", @ok)."\n\n\n";
my $mail = WebGUI::Mail::Send->new($self->session, {
my $mail = WebGUI::Mail::Send->create($self->session, {
to=>$self->session->setting->get("commerceSendDailyReportTo"),
subject=>'Daily recurring payments report'
});