Added email footer setting.

This commit is contained in:
JT Smith 2002-12-01 02:03:11 +00:00
parent 1246c811eb
commit ae2df54ff7
3 changed files with 6 additions and 2 deletions

View file

@ -977,6 +977,8 @@ INSERT INTO template VALUES (1,'Default Site Map','<tmpl_if displayTitle>\r\n
INSERT INTO template VALUES (2,'Descriptive Site Map','<tmpl_if displayTitle>\r\n <h1><tmpl_var title></h1>\r\n</tmpl_if>\r\n\r\n<tmpl_if description>\r\n <tmpl_var description><p/>\r\n</tmpl_if>\r\n\r\n<tmpl_loop page_loop>\r\n <tmpl_var page.indent><a href=\"<tmpl_var page.url>\"><tmpl_var page.title></a> \r\n <tmpl_if page.synopsis>\r\n - <tmpl_var page.synopsis>\r\n </tmpl_if>\r\n <p/>\r\n</tmpl_loop>','SiteMap');
alter table page add column languageId int not null default 1;
insert into international (internationalId,languageId,namespace,message,lastUpdated) values (823,1,'WebGUI','Go to the new page.', 1038706332);
insert into settings values ("mailFooter","^c;\n^e;\n^u;\n");
insert into international (internationalId,languageId,namespace,message,lastUpdated) values (824,1,'WebGUI','Email Footer', 1038708558);

View file

@ -17,6 +17,7 @@ package WebGUI::Mail;
use Net::SMTP;
use strict;
use WebGUI::ErrorHandler;
use WebGUI::Macro;
use WebGUI::Session;
=head1 NAME
@ -74,7 +75,7 @@ use WebGUI::Session;
=cut
sub send {
my ($smtp, $message, $from);
my ($smtp, $message, $from, $footer);
$from = $_[4] || ($session{setting}{companyName}.' <'.$session{setting}{companyEmail}.'>');
#header
$message = "To: $_[0]\n";
@ -86,7 +87,7 @@ sub send {
#body
$message .= $_[2]."\n";
#footer
$message .= "\n $session{setting}{companyName}\n $session{setting}{companyEmail}\n $session{setting}{companyURL}\n";
$message .= "\n".WebGUI::Macro::process($session{setting}{mailFooter});
if ($session{setting}{smtpServer} =~ /\/sendmail/) {
open(MAIL,'| '.$session{setting}{smtpServer}.' -t -oi') or WebGUI::ErrorHandler::warn("Couldn't connect to mail server: ".$session{setting}{smtpServer});
print MAIL $message;

View file

@ -124,6 +124,7 @@ sub www_editMailSettings {
$f = WebGUI::HTMLForm->new;
$f->hidden("op","saveSettings");
$f->textarea("recoverPasswordEmail",WebGUI::International::get(134),$session{setting}{recoverPasswordEmail});
$f->textarea("mailFooter",WebGUI::International::get(824),$session{setting}{mailFooter});
$f->text("smtpServer",WebGUI::International::get(135),$session{setting}{smtpServer});
$f->submit;
$output .= $f->print;