diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 4f87993bc..a1294896f 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -12,6 +12,7 @@ - fixed #12100: Carousel and/or RichEdit - fixed #12103: PayPalStd driver fails occasionally - rfe #12105: Make shortcuts related for export purposes + - rfe #12108: Mail to Group preference field 7.10.13 - added #12079: Carousel Auto Play diff --git a/lib/WebGUI/Operation/Group.pm b/lib/WebGUI/Operation/Group.pm index 39d62ed50..2b6f6089a 100644 --- a/lib/WebGUI/Operation/Group.pm +++ b/lib/WebGUI/Operation/Group.pm @@ -827,6 +827,11 @@ sub www_emailGroup { -label=>$i18n->get(229), -hoverHelp=>$i18n->get('229 description'), ); + $f->yesNo( + -name=>'override', + -label=>$i18n->get('override user email preference'), + -hoverHelp=>$i18n->get('override user email preference description'), + ); $f->HTMLArea( -name=>"message", -label=>$i18n->get(230), @@ -852,11 +857,21 @@ A WebGUI::Session object sub www_emailGroupSend { my $session = shift; - return $session->privilege->adminOnly() unless (canEditGroup($session,$session->form->process("gid")) && $session->form->validToken); - my $mail = WebGUI::Mail::Send->create($session, {toGroup=>$session->form->process("gid"),subject=>$session->form->process("subject"),from=>$session->form->process("from")}); - $mail->addHtml($session->form->process("message","HTMLArea")); - $mail->addFooter; - $mail->queue; + my $f = $session->form; + return $session->privilege->adminOnly() + unless (canEditGroup($session,$f->get('gid')) && $f->validToken); + + WebGUI::Inbox::Message->create( + $session, { + groupId => $f->get('gid'), + subject => $f->get('subject'), + status => 'unread', + message => $f->process('message', 'HTMLArea'), + sentBy => $session->user->userId, + overridePerUserDelivery => $f->get('override'), + extraHeaders => { from => $f->get('from') } + } + ); my $i18n = WebGUI::International->new($session); return _submenu($session,$i18n->get(812)); } diff --git a/lib/WebGUI/i18n/English/WebGUI.pm b/lib/WebGUI/i18n/English/WebGUI.pm index 5bb42ba55..4d23d74f1 100644 --- a/lib/WebGUI/i18n/English/WebGUI.pm +++ b/lib/WebGUI/i18n/English/WebGUI.pm @@ -1445,6 +1445,11 @@ You must be using mod_perl and configure PerlSetEnv SYBASE /opt/sybase/11.0.2 lastUpdated => 1122093200, }, + 'override user email preference description' => { + message => q|Send mail regardless of the users' preferences about receiving inbox notifications|, + lastUpdated => 1302878213, + }, + '230 description' => { message => q|The message that will be sent to all members of the group. The message will be sent in HTML format. No attachments can be included.|, @@ -2243,6 +2248,11 @@ This group could then be named "Employees in HMO 1", and would allow you to rest lastUpdated => 1031514049 }, + 'override user email preference' => { + message => 'Override user email preference?', + lastUpdated => 1302878112, + }, + '866' => { message => q|Expire Notification Message|, lastUpdated => 1101775465,