Kernel::System::SystemAddress

NAME

Kernel::System::SystemAddress – all system address functions

DESCRIPTION

Global module to add/edit/update system addresses.

PUBLIC INTERFACE

new()

create an object

    my $SystemAddressObject = $Kernel::OM->Get('Kernel::System::SystemAddress');

SystemAddressAdd()

add system address with attributes

    my $ID = $SystemAddressObject->SystemAddressAdd(
        Name     => 'info@example.com',
        Realname => 'Hotline',
        ValidID  => 1,
        QueueID  => 123,
        Comment  => 'some comment',
        UserID   => 123,
    );

SystemAddressGet()

get system address with attributes

    my %SystemAddress = $SystemAddressObject->SystemAddressGet(
        ID => 1,
    );

returns:

    %SystemAddress = (
        ID         => 1,
        Name       => 'info@example.com'
        Realname   => 'Hotline',
        QueueID    => 123,
        Comment    => 'some comment',
        ValidID    => 1,
        CreateTime => '2010-11-29 11:04:04',
        ChangeTime => '2010-12-07 12:33:56',
    )

SystemAddressUpdate()

update system address with attributes

    $SystemAddressObject->SystemAddressUpdate(
        ID       => 1,
        Name     => 'info@example.com',
        Realname => 'Hotline',
        ValidID  => 1,
        QueueID  => 123,
        Comment  => 'some comment',
        UserID   => 123,
    );

SystemAddressList()

get a list of system addresses

    my %List = $SystemAddressObject->SystemAddressList(
        Valid => 0,  # optional, defaults to 1
    );

returns:

    %List = (
        '1' => 'sales@example.com',
        '2' => 'purchasing@example.com',
        '3' => 'service@example.com',
    );

SystemAddressIsLocalAddress()

Checks if the given address is a local (system) address. Returns true for local addresses.

    if ( $SystemAddressObject->SystemAddressIsLocalAddress( Address => 'info@example.com' ) ) {
        # is local
    }
    else {
        # is not local
    }

SystemAddressQueueID()

find dispatching queue id of email address

    my $QueueID = $SystemAddressObject->SystemAddressQueueID( Address => 'info@example.com' );

SystemAddressQueueList()

get a list of the queues and their system addresses IDs

    my %List = $SystemAddressObject->SystemAddressQueueList(
        Valid => 0,  # optional, defaults to 1
    );

returns:

    %List = (
        '5' => 3,
        '7' => 1,
        '9' => 2,
    );

NameExistsCheck()

return 1 if another system address with this name already exists

    $Exist = $SystemAddressObject->NameExistsCheck(
        Name => 'Some Address',
        ID => 1, # optional
    );

SystemAddressIsUsed()

Return 1 if system address is used in one of the queue's or auto response's.

    $SytemAddressIsUsed = $SystemAddressObject->SystemAddressIsUsed(
        SystemAddressID => 1,
    );
Scroll to Top