
####
Base
####


****
NAME
****


Kernel::System::Ticket::Event::NotificationEvent::Transport::Base - common notification event transport functions


****************
PUBLIC INTERFACE
****************


SendNotification()
==================


send a notification using an specified transport


.. code-block:: perl

     my $Success = $TransportObject->SendNotification(
         TicketID     => $Param{Data}->{TicketID},
         UserID       => $Param{UserID},
         Notification => \%Notification,
         Recipient    => {
             UserID        => 123,
             UserLogin     => 'some login',
             UserTitle     => 'some title',
             UserFirstname => 'some first name',
             UserLastname  => 'some last name',
             # ...
         },
         Event                 => $Param{Event},
         Attachments           => \@Attachments,         # optional
     );


returns


.. code-block:: perl

     $Success = 1;       # or false in case of an error



GetTransportRecipients()
========================


generates a list of recipients exclusive for a determined transport, the content of the list is
usually an attribute of an Agent or Customer and it depends on each transport


.. code-block:: perl

     my @TransportRecipients = $TransportObject->GetTransportRecipients(
         Notification => \%Notification,
     );


returns:


.. code-block:: perl

     @TransportRecipents = (
         {
             UserEmail     => 'some email',       # optional
             UserFirstname => 'some name',        # optional
             # ...                                # optional
         }
     );


or
    @TransportRecipients = undef;   in case of an error


TransportSettingsDisplayGet()
=============================


generates and returns the HTML code to display exclusive settings for each transport.


.. code-block:: perl

     my $HTMLOutput = $TransportObject->TransportSettingsDisplayGet(
         Data => $NotificationDataAttribute,           # as retrieved from Kernel::System::NotificationEvent::NotificationGet()
     );


returns


.. code-block:: perl

     $HTMLOutput = 'some HTML code';



TransportParamSettingsGet()
===========================


gets specific parameters from the web request and put them back in the GetParam attribute to be
saved in the notification as the standard parameters


.. code-block:: perl

     my $Success = $TransportObject->TransportParamSettingsGet(
         GetParam => $ParmHashRef,
     );


returns


.. code-block:: perl

     $Success = 1;       # or false in case of a failure



IsUsable();
===========


returns if the transport can be used in the system environment,


.. code-block:: perl

     my $Success = $TransportObject->IsUsable();


returns


.. code-block:: perl

     $Success = 1;       # or false



GetTransportEventData()
=======================


returns the needed event information after a notification has been sent


.. code-block:: perl

     my $EventData = $TransportObject-> GetTransportEventData();


returns:


.. code-block:: perl

     $EventData = {
         Event => 'ArticleAgentNotification',    # or 'ArticleCustomerNotification'
         Data  => {
             TicketID  => 123,
             ArticleID => 123,                   # optional
         },
         UserID => 123,
     );



_ReplaceTicketAttributes()
==========================


returns the specified field with replaced OTRS tags


.. code-block:: perl

     my $RecipientEmail = $Self->_ReplaceTicketAttributes(
         Ticket => $Param{Ticket},
         Field  => '<OTRS_TICKET_DynamicField_Name1>',       # value of DynamicField_Name1 is 'two@stars.com'
     );


returns:


.. code-block:: perl

     my $RecipientEmail = 'two@stars.com';





