[Bps-public-commit] rt-extension-excelfeed 01/02: Update dashboard mailer with user context changes

Jim Brandt jbrandt at bestpractical.com
Fri Aug 6 17:15:37 UTC 2021


This is an automated email from the git hooks/post-receive script.

jbrandt pushed a commit to branch user-context-cfs
in repository rt-extension-excelfeed.

commit c12316de109befaa5f254e5217dd03f55731d6bd
Author: Jim Brandt <jbrandt at bestpractical.com>
AuthorDate: Tue Sep 3 17:18:51 2019 -0400

    Update dashboard mailer with user context changes
---
 lib/RT/Dashboard/Mailer_Vendor.pm | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/lib/RT/Dashboard/Mailer_Vendor.pm b/lib/RT/Dashboard/Mailer_Vendor.pm
index 09a8875..5766c70 100644
--- a/lib/RT/Dashboard/Mailer_Vendor.pm
+++ b/lib/RT/Dashboard/Mailer_Vendor.pm
@@ -57,6 +57,7 @@ sub SendDashboard {
     my $self = shift;
     my %args = (
         CurrentUser  => undef,
+        ContextUser  => undef,
         Email        => undef,
         Subscription => undef,
         DryRun       => 0,
@@ -64,8 +65,8 @@ sub SendDashboard {
     );
 
     my $currentuser  = $args{CurrentUser};
+    my $context_user = $args{ContextUser} || $currentuser;
     my $subscription = $args{Subscription};
-
     my $rows = $subscription->SubValue('Rows');
 
     my $DashboardId = $subscription->SubValue('DashboardId');
@@ -82,17 +83,19 @@ sub SendDashboard {
         );
     }
 
-    $RT::Logger->debug('Generating dashboard "'.$dashboard->Name.'" for user "'.$currentuser->Name.'":');
+    $RT::Logger->debug('Generating dashboard "'.$dashboard->Name.'" for user "'.$context_user->Name.'":');
 
     if ($args{DryRun}) {
         print << "SUMMARY";
     Dashboard: @{[ $dashboard->Name ]}
-    User:   @{[ $currentuser->Name ]} <$args{Email}>
+    Subscription Owner: @{[ $currentuser->Name ]}
+    Recipient: <$args{Email}>
 SUMMARY
         return;
     }
 
     local $HTML::Mason::Commands::session{CurrentUser} = $currentuser;
+    local $HTML::Mason::Commands::session{ContextUser} = $context_user;
     local $HTML::Mason::Commands::r = RT::Dashboard::FakeRequest->new;
 
     my $HasResults = undef;

-- 
To stop receiving notification emails like this one, please contact
sysadmin at bestpractical.com.


More information about the Bps-public-commit mailing list