Kernel::System::Ticket::Article::Backend::SMS

NAME

Kernel::System::Ticket::Article::Backend::SMS – backend class for Short Message Service based articles

DESCRIPTION

This class provides functions to manipulate Short Message Service based articles in the database.

Inherits from Kernel::System::Ticket::Article::Backend::Base, please have a look there for its base API, and below for the additional functions this backend provides.

PUBLIC INTERFACE

ArticleCreate()

Create a Short Message Service article.

    my $ArticleID = $ArticleBackendObject->ArticleCreate(
        TicketID             => 123,                              # (required)
        SenderTypeID         => 1,                                # (required)
                                                                  # or
        SenderType           => 'agent',                          # (required) agent|system|customer
        SenderString         => 'BRANDNAME',                      # (required) Alphanumeric sender ID for the message
        IsVisibleForCustomer => 1,                                # (required) Is article visible to customer?
        PhoneNumbers         => [                                 # (required) Array reference of recipient phone numbers
            '+49123456789',                                                    in international format
            '+49987654321',
        ],
        Text                 => 'My SMS message',                 # (required) Message text
        IsFlashMessage       => 0,                                # (required) Is this class 0 (flash) message?
        TransactionNumbers   => [                                 # (required) Returned by the cloud service, one per
            'ddd87dc3146d6e4d5da2cc06494879f8',                   #            each recipient message sent
            'c5cbc26d4bcb371469e874806ccb349c',
        ],
        UserID => 123,                                            # (required)
    );

Events: ArticleCreate

ArticleGet()

Returns single article data.

    my %Article = $ArticleBackendObject->ArticleGet(
        TicketID       => 123,   # (required)
        ArticleID      => 123,   # (required)
        DynamicFields  => 1,     # (optional) To include the dynamic field values for this article on the return structure.
    );

Returns:

    %Article = (
        TicketID             => 123,
        ArticleID            => 123,
        SenderTypeID         => 1,
        SenderType           => 'agent',
        IsVisibleForCustomer => 1,
        SenderString         => 'BRANDNAME',
        PhoneNumbers         => [
            '+49123456789',
            '+49987654321',
        ],
        Text                 => 'My SMS message',
        IsFlashMessage       => 0,
        TransactionNumbers   => [
            'ddd87dc3146d6e4d5da2cc06494879f8',
            'c5cbc26d4bcb371469e874806ccb349c',
        ],
        CreateBy             => 1,
        CreateTime           => '2017-03-28 08:33:47',

        # If DynamicFields => 1 was passed, you'll get an entry like this for each dynamic field:
        DynamicField_X => 'value_x',
    );

ArticleUpdate()

Update article data.

Note: Keys SenderString, PhoneNumbers, Text, IsFlashMessage and TransactionNumbers are implemented.

    my $Success = $ArticleBackendObject->ArticleUpdate(
        TicketID  => 123,                   # (required)
        ArticleID => 123,                   # (required)
        Key       => 'PhoneNumbers',        # (optional)
        Value     => [                      # (required) if Key is supplied
            '+4956789123',
        ],
        UserID => 123,                      # (required)
    );

    my $Success = $ArticleBackendObject->ArticleUpdate(
        TicketID  => 123,
        ArticleID => 123,
        Key       => 'SenderType',
        Value     => 'agent',
        UserID    => 123,
    );

Events: ArticleUpdate

ArticleDelete()

Delete article data.

    my $Success = $ArticleBackendObject->ArticleDelete(
        TicketID  => 123,
        ArticleID => 123,
        UserID    => 123,
    );

BackendSearchableFieldsGet()

Get the definition of the searchable fields as a hash.

    my %SearchableFields = $ArticleBackendObject->BackendSearchableFieldsGet();

Returns:

    my %SearchableFields = (
        'SMS_PhoneNumbers' => {
            Label      => 'Article SMS Message Phone Number',
            Key        => 'SMS_PhoneNumbers',
            Type       => 'Text',
            Filterable => 0,
        },
        'SMS_TransactionNumbers' => {
            Label      => 'Article SMS Message Transaction Number',
            Key        => 'SMS_TransactionNumbers',
            Type       => 'Text',
            Filterable => 0,
        },
        'SMS_Text' => {
            Label      => 'Article SMS Message text',
            Key        => 'SMS_Text',
            Type       => 'Text',
            Filterable => 1,
        },
    );

ArticleSearchableContentGet()

Get article attachment index as hash.

    my %Index = $ArticleBackendObject->ArticleSearchableContentGet(
        TicketID       => 123,   # (required)
        ArticleID      => 123,   # (required)
        DynamicFields  => 1,     # (optional) To include the dynamic field values for this article on the return structure.
        RealNames      => 1,     # (optional) To include the From/To/Cc fields with real names.
        UserID         => 123,   # (required)
    );

Returns:

    my %ArticleSearchData = {
        'PhoneNumbers'    => {
            String     => '+49123456789 +49987654321',
            Key        => 'PhoneNumbers',
            Type       => 'Text',
            Filterable => 0,
        },
        'TransactionNumbers'    => {
            String     => 'ddd87dc3146d6e4d5da2cc06494879f8 c5cbc26d4bcb371469e874806ccb349c',
            Key        => 'TransactionNumbers',
            Type       => 'Text',
            Filterable => 0,
        },
        'Text'    => {
            String     => 'My SMS message',
            Key        => 'Text',
            Type       => 'Text',
            Filterable => 1,
        },
    };

ArticleHasHTMLContent()

Dummy function. The Short Message Service backend will always return 0.

ArticleAttachmentIndex()

Dummy function. The Short Message Service backend will not return any attachments.

Scroll to Top