diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 32b1aff69..62f4db5ae 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -21,6 +21,7 @@ - rfe #9355: Password Recovery email subject (SDH Consulting Group) - added: Users can now set a minimum cart amount required for checkout. ( Martin Kamerbeek / Oqapi ) - fixed validation issue in the donation asset ( Martin kamerbeek / Oqapi ) + - rfe #9354: Account activation email template (SDH Consulting Group) 7.6.14 - fixed: IE6 shows Admin Bar over Asset Manager diff --git a/docs/upgrades/packages-7.7.0/root_import_auth_webgui_create_default-webgui-account-activation-template.wgpkg b/docs/upgrades/packages-7.7.0/root_import_auth_webgui_create_default-webgui-account-activation-template.wgpkg new file mode 100644 index 000000000..a24ae78af Binary files /dev/null and b/docs/upgrades/packages-7.7.0/root_import_auth_webgui_create_default-webgui-account-activation-template.wgpkg differ diff --git a/docs/upgrades/upgrade_7.6.14-7.7.0.pl b/docs/upgrades/upgrade_7.6.14-7.7.0.pl index 2ec1eaa05..a614dffc7 100644 --- a/docs/upgrades/upgrade_7.6.14-7.7.0.pl +++ b/docs/upgrades/upgrade_7.6.14-7.7.0.pl @@ -33,6 +33,7 @@ my $session = start(); # this line required # upgrade functions go here +addAccountActivationTemplateToSettings( $session ); addGroupToAddToMatrix( $session ); addScreenshotTemplatesToMatrix( $session ); surveyDoAfterTimeLimit($session); @@ -55,6 +56,16 @@ createShopAcccountPluginSettings( $session ); finish($session); # this line required + +#---------------------------------------------------------------------------- +sub addAccountActivationTemplateToSettings { + my $session = shift; + print "\tAdding account activation template to settings \n" unless $quiet; + + $session->db->write("insert into settings (name, value) values ('webguiAccountActivationTemplate','PBtmpl0000000000000016')"); + print "Done.\n" unless $quiet; +} + #---------------------------------------------------------------------------- sub addGroupToAddToMatrix { my $session = shift; diff --git a/lib/WebGUI/Auth/WebGUI.pm b/lib/WebGUI/Auth/WebGUI.pm index 600286f2a..a0bc70e45 100644 --- a/lib/WebGUI/Auth/WebGUI.pm +++ b/lib/WebGUI/Auth/WebGUI.pm @@ -273,10 +273,13 @@ sub createAccountSave { to => $profile->{email}, subject => $i18n->get('email address validation email subject','AuthWebGUI') }); - $mail->addText( - $i18n->get('email address validation email body','AuthWebGUI') . "\n\n" - . $session->url->page("op=auth;method=validateEmail;key=".$key, 'full') . "\n\n" - ); + my $var; + $var->{newUser_username} = $username; + $var->{activationUrl} = $session->url->page("op=auth;method=validateEmail;key=".$key, 'full'); + my $text = +WebGUI::Asset::Template->new($self->session,$self->getSetting('accountActivationTemplate'))->process($var); + WebGUI::Macro::process($self->session,\$text); + $mail->addText($text); $mail->addFooter; $mail->send; $self->user->status("Deactivated"); @@ -574,7 +577,14 @@ sub editUserSettingsForm { -label => $i18n->get("password recovery template"), -hoverHelp => $i18n->get("password recovery template help") ); - return $f->printRowsOnly; + $f->template( + -name => "webguiAccountActivationTemplate", + -value => $self->session->setting->get("webguiAccountActivationTemplate"), + -namespace => "Auth/WebGUI/Activation", + -label => $i18n->get("account activation template"), + -hoverHelp => $i18n->get("account activation template help") + ); + return $f->printRowsOnly; } #------------------------------------------------------------------- @@ -625,6 +635,7 @@ sub editUserSettingsFormSave { $s->set("webguiExpiredPasswordTemplate", $f->process("webguiExpiredPasswordTemplate","template")); $s->set("webguiLoginTemplate", $f->process("webguiLoginTemplate","template")); $s->set("webguiPasswordRecoveryTemplate", $f->process("webguiPasswordRecoveryTemplate","template")); + $s->set("webguiAccountActivationTemplate", $f->process("webguiAccountActivationTemplate","template")); if (@errors) { return \@errors; diff --git a/lib/WebGUI/Help/AuthWebGUI.pm b/lib/WebGUI/Help/AuthWebGUI.pm index 5e6c1674c..6103b6cea 100644 --- a/lib/WebGUI/Help/AuthWebGUI.pm +++ b/lib/WebGUI/Help/AuthWebGUI.pm @@ -163,6 +163,16 @@ our $HELP = { related => [], }, + 'account activation template' => { + title => 'account activation template title', + body => '', + variables => [ + { 'name' => 'newUser_username' }, + { 'name' => 'activationUrl' }, + ], + fields => [], + related => [] + }, }; 1; diff --git a/lib/WebGUI/i18n/English/AuthWebGUI.pm b/lib/WebGUI/i18n/English/AuthWebGUI.pm index dbc8241c1..5d70b81e0 100644 --- a/lib/WebGUI/i18n/English/AuthWebGUI.pm +++ b/lib/WebGUI/i18n/English/AuthWebGUI.pm @@ -62,6 +62,29 @@ our $I18N = { lastUpdated => 1227210876, }, + 'account activation template title' => { + message => q|WebGUI Authentication Account Activation Mail Template|, + lastUpdated => 1230600500, + context => q|The title of the help page for the webgui auth welcome message template.|, + }, + + 'account activation template' => { + message => q|Account Activation Mail Template|, + lastUpdated => 1230600500, + context => q|The label for the 'account activation template' field on the Authentication tab of the Settings screen.|, + }, + + 'account activation template help' => { + message => q|Select a template for the account activation mail that is sent to new users.|, + lastUpdated => 1230600500, + context => q|The description of the 'account activation template' field on the Authentication tab of the Settings screen, displayed as hoverhelp.|, + }, + + 'activationUrl' => { + message => q|The url to activate the newly created account.|, + lastUpdated => 1230600500, + }, + 'use captcha' => { message => q|Use captcha image?|, lastUpdated => 1078852836