From f14832a583c5c0963083995c922ecc1c42a93eb2 Mon Sep 17 00:00:00 2001 From: Yung Han Khoe Date: Wed, 18 Mar 2009 20:25:01 +0000 Subject: [PATCH] making account activation email templatable --- docs/changelog/7.x.x.txt | 1 + ...t-webgui-account-activation-template.wgpkg | Bin 0 -> 823 bytes docs/upgrades/upgrade_7.6.14-7.7.0.pl | 11 +++++++++ lib/WebGUI/Auth/WebGUI.pm | 21 ++++++++++++---- lib/WebGUI/Help/AuthWebGUI.pm | 10 ++++++++ lib/WebGUI/i18n/English/AuthWebGUI.pm | 23 ++++++++++++++++++ 6 files changed, 61 insertions(+), 5 deletions(-) create mode 100644 docs/upgrades/packages-7.7.0/root_import_auth_webgui_create_default-webgui-account-activation-template.wgpkg 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 0000000000000000000000000000000000000000..a24ae78afc6d5b9cf0e71ccd72689030c74fe883 GIT binary patch literal 823 zcmV-71IYXziwFP!000001MO8^Z`v>v<+;Bi$_ty+mIMMRY??${HqhFNwY1f?Zj*^! z@JQ^`cA#wPf1f{qcu-#2GVK9N*vKFEo_o%{H~WRn56|<$YPC?1tFP8dXoj;GUcvYM znpds{URWtOzUK#WkykfAGA;m<&?cxq$news$>8MBLF)DCmj3BWjoP>7K>x4mxxD|A zQ}S#)(pD`9*6LsJ%H<{f11|^*j%0K5V^jL?Zyx$fc=){|i_qnQGB7}{({R3i+tphs zqbXtnBd&J!HFYy$2nYlZr)t-&xcag>hyfR^`;;flLfbrdN~<7bS>pK^BWWv%3ePh-O5{Rp2oYn36q#q#qUk zf)32v7(zs}ec#^iGAgK;riLtwivgoq+JP;I#d63C`%07V9U>4T+B1k>6;T3k>;MQE z;@la77(;#Ln1eor)8cNiDdW0E{STL&;_Ejz?1re{TgA_hFDybGeyJlSlj zhjh{*?vrLtO9T}x;md8 z-i5FQS_dENliUdA7gH{ac9{qrdb->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