[otrs-cvs] otrs/Kernel/System/Ticket/Event NotificationEvent.pm, 1.45, 1.46

"CVS commits notifications of OTRS.org" <[email protected]>
Newsgroups gmane.comp.otrs.cvs
Message-ID <[email protected]>
Comments:
Update of /home/cvs/otrs/Kernel/System/Ticket/Event
In directory lancelot:/tmp/cvs-serv28451/Kernel/System/Ticket/Event

Modified Files:
	NotificationEvent.pm 
Log Message:
Fixed bug#8974 - Event Based Notification does not populate REALNAME with Customer User data.

Author: mb

Index: NotificationEvent.pm
===================================================================
RCS file: /home/cvs/otrs/Kernel/System/Ticket/Event/NotificationEvent.pm,v
retrieving revision 1.45
retrieving revision 1.46
diff -2 -u -d -r1.45 -r1.46
--- NotificationEvent.pm	20 Nov 2012 16:01:10 -0000	1.45
+++ NotificationEvent.pm	10 Dec 2012 15:09:06 -0000	1.46
@@ -540,9 +540,4 @@
     }
 
-    # prepare customer realname
-    if ( $Notification{Body} =~ /<OTRS_CUSTOMER_REALNAME>/ && $Recipient{Realname} ) {
-        $Notification{Body} =~ s/<OTRS_CUSTOMER_REALNAME>/$Recipient{Realname}/g;
-    }
-
     # replace config options
     $Notification{Body}    =~ s{<OTRS_CONFIG_(.+?)>}{$Self->{ConfigObject}->Get($1)}egx;
@@ -562,4 +557,13 @@
         DynamicFields => 1,
     );
+
+    # prepare customer realname
+    if ( $Notification{Body} =~ /<OTRS_CUSTOMER_REALNAME>/ ) {
+        my $RealName = $Self->{CustomerUserObject}->CustomerName(
+            UserLogin => $Ticket{CustomerUserID}
+        ) || $Recipient{Realname};
+        $Notification{Body} =~ s/<OTRS_CUSTOMER_REALNAME>/$RealName/g;
+    }
+
     for my $Key ( sort keys %Ticket ) {
         next if !defined $Ticket{$Key};
---------------------------------------------------------------------
OTRS mailing list: cvs-log - Webpage: http://otrs.org/
Archive: http://lists.otrs.org/pipermail/cvs-log
To unsubscribe: http://lists.otrs.org/cgi-bin/listinfo/cvs-log
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.