Skip to content

Commit

Permalink
Fixed migration of mention notification.
Browse files Browse the repository at this point in the history
  • Loading branch information
jepf committed Jan 25, 2024
1 parent 7c11576 commit cf13389
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# 6.5.6 2024-??-??
- 2024-01-25 Fixed migration of mention notification.
- 2024-01-19 Fixed slow regular expression in postmaster attachment detection.
- 2024-01-18 Exchanged CKEditor 4.22.1 source version with minified version to improve browser loading times. [#535](https://github.com/znuny/Znuny/issues/533)
- 2024-01-11 Fixed appointment notifications not being sent if crypting/signing options were configured.
Expand Down
16 changes: 13 additions & 3 deletions scripts/Migration/Znuny/MigrateNotificationEvents.pm
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,12 @@ package scripts::Migration::Znuny::MigrateNotificationEvents; ## no critic
use strict;
use warnings;

use utf8;

use parent qw(scripts::Migration::Base);

use Kernel::System::VariableCheck qw(:all);

our @ObjectDependencies = (
'Kernel::System::NotificationEvent',
);
Expand Down Expand Up @@ -108,24 +112,30 @@ sub _MigrateMentionNotification {
my $NotificationEvent = $NotificationEvents{$NotificationEventID};
next NOTIFICATIONEVENTID if !$NotificationEventsToUpdateByName{ $NotificationEvent->{Name} };

$NotificationEvent->{Message}->{en}->{Body} = 'Hi <OTRS_NOTIFICATION_RECIPIENT_UserFirstname>,
if ( IsHashRefWithData( $NotificationEvent->{Message}->{en} ) ) {
$NotificationEvent->{Message}->{en}->{ContentType} = 'text/plain';
$NotificationEvent->{Message}->{en}->{Body} = 'Hi <OTRS_NOTIFICATION_RECIPIENT_UserFirstname>,
you have been mentioned in ticket <OTRS_TICKET_NUMBER>.
<OTRS_AGENT_BODY[5]>
<OTRS_CONFIG_HttpType>://<OTRS_CONFIG_FQDN>/<OTRS_CONFIG_ScriptAlias>index.pl?Action=AgentTicketZoom;TicketID=<OTRS_TICKET_TicketID>
-- <OTRS_CONFIG_NotificationSenderName>';
}

$NotificationEvent->{Message}->{de}->{Body}
= 'Hallo <OTRS_NOTIFICATION_RECIPIENT_UserFirstname> <OTRS_NOTIFICATION_RECIPIENT_UserLastname>,
if ( IsHashRefWithData( $NotificationEvent->{Message}->{de} ) ) {
$NotificationEvent->{Message}->{de}->{ContentType} = 'text/plain';
$NotificationEvent->{Message}->{de}->{Body}
= 'Hallo <OTRS_NOTIFICATION_RECIPIENT_UserFirstname> <OTRS_NOTIFICATION_RECIPIENT_UserLastname>,
Sie wurden erwähnt in Ticket <OTRS_TICKET_NUMBER>.
<OTRS_AGENT_BODY[5]>
<OTRS_CONFIG_HttpType>://<OTRS_CONFIG_FQDN>/<OTRS_CONFIG_ScriptAlias>index.pl?Action=AgentTicketZoom;TicketID=<OTRS_TICKET_TicketID>
-- <OTRS_CONFIG_NotificationSenderName>';
}

my $NotificationEventUpdated = $NotificationEventObject->NotificationUpdate(
%{$NotificationEvent},
Expand Down

0 comments on commit cf13389

Please sign in to comment.