Kernel::System::SystemAddress - all system address functions
Global module to add/edit/update system addresses.
create an object
my $SystemAddressObject = $Kernel::OM->Get('Kernel::System::SystemAddress');
add system address with attributes
my $ID = $SystemAddressObject->SystemAddressAdd( Name => 'info@example.com', Realname => 'Hotline', ValidID => 1, QueueID => 123, Comment => 'some comment', UserID => 123, );
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', )
update system address with attributes
$SystemAddressObject->SystemAddressUpdate( ID => 1, Name => 'info@example.com', Realname => 'Hotline', ValidID => 1, QueueID => 123, Comment => 'some comment', UserID => 123, );
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', );
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 }
find dispatching queue id of email address
my $QueueID = $SystemAddressObject->SystemAddressQueueID( Address => 'info@example.com' );
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, );
return 1 if another system address with this name already exists
$Exist = $SystemAddressObject->NameExistsCheck( Name => 'Some Address', ID => 1, # optional );
Return 1 if system address is used in one of the queue's or auto response's.
$SytemAddressIsUsed = $SystemAddressObject->SystemAddressIsUsed( SystemAddressID => 1, );
This software is part of the OTRS project (https://otrs.org/).
This software comes with ABSOLUTELY NO WARRANTY. For details, see the enclosed file COPYING for license information (GPL). If you did not receive this file, see https://www.gnu.org/licenses/gpl-3.0.txt.