Kernel::System::SMSTemplate

NAME

Kernel::System::SMSTemplate – Short Message Service template library

DESCRIPTION

All Short Message Service template functions, e.g. to add template or other functions.

PUBLIC INTERFACE

new()

Create an object.

    my $SMSTemplateObject = $Kernel::OM->Get('Kernel::System::SMSTemplate');

SMSTemplateAdd()

Add new Short Message Service template.

    my $ID = $SMSTemplateObject->SMSTemplateAdd(
        Name           => 'New SMS Template',               # (required)
        Template       => 'Thank you for your inquiry.',    # (required)
        IsFlashMessage => 0,                                # (required) 0|1
        TemplateType   => 'Answer',                         # (required) 'Answer' or 'Create'
        Comment        => 'This is a comment',              # (optional)
        ValidID        => 1,                                # (required)
        UserID         => 123,                              # (required)
    );

SMSTemplateGet()

Get Short Message Service template attributes.

    my %SMSTemplate = $SMSTemplateObject->SMSTemplateGet(
        ID => 123,              # (required)
                                # or
        Name => 'SMS Template', # (required)
    );

Returns:

    %SMSTemplate = (
        ID             => 123,
        Name           => 'SMS Template',
        Template       => 'Template content',
        IsFlashMessage => 0,
        TemplateType   => 'Answer',
        Comment        => 'Some comment',
        ValidID        => 1,
        CreateTime     => '2017-07-24 14:11:229',
        CreateBy       => 1,
        ChangeTime     => '2017-07-24 14:11:229',
        ChangeBy       => 1,
    );

SMSTemplateDelete()

Delete a Short Message Service template.

    $SMSTemplateObject->SMSTemplateDelete(
        ID => 123,
    );

SMSTemplateUpdate()

Update Short Message Service template attributes.

    my $Success = $SMSTemplateObject->SMSTemplateUpdate(
        ID             => 123,                              # (required)
        Name           => 'New SMS Template',               # (required)
        Template       => 'Thank you for your inquiry.',    # (required)
        IsFlashMessage => 0,                                # (required) 0|1
        TemplateType   => 'Answer',                         # (required) 'Answer' or 'Create'
        Comment        => 'This is a comment',              # (optional)
        ValidID        => 1,                                # (required)
        UserID         => 123,                              # (required)
    );

Returns 1 if update was successful.

SMSTemplateLookup()

Return the name or the Short Message Service template ID.

    my $Name = $SMSTemplateObject->SMSTemplateLookup(
        ID => 123,
    );

    or

    my $ID = $SMSTemplateObject->SMSTemplateLookup(
        Name => 'SMS Template',
    );

SMSTemplateList()

Get Short Message Service templates.

    my %SMSTemplates = $SMSTemplateObject->SMSTemplateList(
        Valid => 0,         # (optional) Filter templates based on validity.
        Type  => 'Answer',  # (optional) Filter certain template type.
    );

Returns:

    %SMSTemplates = (
        1 => 'Some Name',
        2 => 'Some Name2',
        3 => 'Some Name3',
    );

QueueSMSTemplateMemberAdd()

Add an Short Message Service template to a queue.

    my $Success = $SMSTemplateObject->QueueSMSTemplateMemberAdd(
        QueueID       => 123,
        SMSTemplateID => 123,
        Active        => 1,     # to set/confirm (1) or remove (0) the relation
        UserID        => 123,
    );

QueueSMSTemplateMemberList()

Get Short Message Service templates of a queue.

    my %Templates = $SMSTemplateObject->QueueSMSTemplateMemberList( QueueID => 123 );

Returns:

    %Templates = (
        1 => 'Some Name',
        2 => 'Some Name',
    );

    my %Responses = $SMSTemplateObject->QueueSMSTemplateMemberList(
        QueueID       => 123,
        TemplateTypes => 1,
    );

Returns:

    %Responses = (
        Answer => {
            1 => 'Some Name',
            2 => 'Some Name',
        },
        # ...
    );

    my %Queues = $SMSTemplateObject->QueueSMSTemplateMemberList( SMSTemplateID => 123 );

Returns:

    %Queues = (
        1 => 'Some Name',
        2 => 'Some Name',
    );
Scroll to Top