NAME
Kernel::System::TemplateGenerator – signature lib
DESCRIPTION
All signature functions.
PUBLIC INTERFACE
new()
Don't use the constructor directly, use the ObjectManager instead:
my $TemplateGeneratorObject = $Kernel::OM->Get('Kernel::System::TemplateGenerator');
Salutation()
generate salutation
my $Salutation = $TemplateGeneratorObject->Salutation(
TicketID => 123,
UserID => 123,
Data => $ArticleHashRef,
);
returns Text ContentType
Signature()
generate salutation
my $Signature = $TemplateGeneratorObject->Signature(
UserID => 123, # (required) UserID
Data => $ArticleHashRef, # (required) Data used for tag replacement
TicketID => 123, # (required) TicketID
# or
QueueID => 123, # (required) QueueID
RichText => 1, # (optional) request HTML or plain content
# (by default, system takes Frontend::RichText value.
);
returns
$Signature = 'Signature text';
Sender()
generate sender address (FROM string) for emails
my $Sender = $TemplateGeneratorObject->Sender(
QueueID => 123,
UserID => 123,
);
returns:
John Doe at Super Support <service@example.com>
and it returns the quoted real name if necessary
"John Doe, Support" <service@example.tld>
Template()
generate template
my $Template = $TemplateGeneratorObject->Template(
TemplateID => 123
TicketID => 123, # Optional
Data => $ArticleHashRef, # Optional
UserID => 123,
);
Returns:
$Template => 'Some text';
Subject()
generate subject
my $Subject = $TemplateGeneratorObject->Subject(
TemplateID => 123
TicketID => 123, # Optional
Data => $ArticleHashRef, # Optional
Subject => 'Subject',
UserID => 123,
);
Returns:
$Subject => 'Some text';
GenericAgentArticle()
generate internal or external notes
my $GenericAgentArticle = $TemplateGeneratorObject->GenericAgentArticle(
Notification => $NotificationDataHashRef,
TicketID => 123,
UserID => 123,
Data => $ArticleHashRef, # Optional
);
Attributes()
generate attributes
my %Attributes = $TemplateGeneratorObject->Attributes(
TicketID => 123,
ArticleID => 123,
ResponseID => 123
UserID => 123,
Action => 'Forward', # Possible values are Reply and Forward, Reply is default.
);
returns StandardResponse Salutation Signature
AutoResponse()
generate response
AutoResponse TicketID Owner Responsible CUSTOMER_DATA ArticleID CUSTOMER_SUBJECT CUSTOMER_EMAIL UserID
To
Cc
Bcc
Subject
Body
ContentType
my %AutoResponse = $TemplateGeneratorObject->AutoResponse(
TicketID => 123,
OrigHeader => {},
AutoResponseType => 'auto reply',
UserID => 123,
);
NotificationEvent()
replace all OTRS smart tags in the notification body and subject
my %NotificationEvent = $TemplateGeneratorObject->NotificationEvent(
TicketData => $TicketDataHashRef,
Recipient => $UserDataHashRef, # Agent or Customer data get result
Notification => $NotificationDataHashRef,
CustomerMessageParams => $ArticleHashRef, # optional
UserID => 123,
);
MultipleStrings()
replace smart tag in a single string.
my $MultipleStrings = $TemplateGeneratorObject->MultipleStrings(
Strings => $String|$ArrayRef, # (required) Tag string(s) for replacement
UserID => 123, # (required) UserID
Data => $ArticleHashRef, # (required) Data used for tag replacement
TicketID => 123, # (required) TicketID
RichText => 1, # (optional) request HTML or plain content
# (by default, system takes Frontend::RichText value.
);
returns
$ReplacedText = 'ObjectValue';