Skip to content

Commit

Permalink
Merge branch '5.0/dashboard-email-subject-method' into 5.0-trunk
Browse files Browse the repository at this point in the history
  • Loading branch information
sunnavy committed Apr 3, 2024
2 parents e84269f + 3049ead commit 8f03658
Showing 1 changed file with 26 additions and 5 deletions.
31 changes: 26 additions & 5 deletions lib/RT/Dashboard/Mailer.pm
Original file line number Diff line number Diff line change
Expand Up @@ -479,22 +479,18 @@ sub ObsoleteSubscription {
}
}

sub EmailDashboard {
sub DashboardSubject {
my $self = shift;
my %args = (
CurrentUser => undef,
Email => undef,
Dashboard => undef,
Subscription => undef,
Content => undef,
@_,
);

my $subscription = $args{Subscription};
my $dashboard = $args{Dashboard};
my $currentuser = $args{CurrentUser};
my $email = $args{Email};

my $frequency = $subscription->SubValue('Frequency');

my %frequency_lookup = (
Expand All @@ -512,6 +508,31 @@ sub EmailDashboard {
$currentuser->loc($frequency_display),
$dashboard->Name;

return $subject;
}

sub EmailDashboard {
my $self = shift;
my %args = (
CurrentUser => undef,
Email => undef,
Dashboard => undef,
Subscription => undef,
Content => undef,
@_,
);

my $subscription = $args{Subscription};
my $dashboard = $args{Dashboard};
my $currentuser = $args{CurrentUser};
my $email = $args{Email};

my $subject = $self->DashboardSubject(
CurrentUser => $currentuser,
Dashboard => $dashboard,
Subscription => $subscription,
);

my $entity = $self->BuildEmail(
%args,
To => $email,
Expand Down

0 comments on commit 8f03658

Please sign in to comment.