You are on page 1of 29

HP Service Manager

outbound HTML email package


Bruno De Graeve
Technical Consultant (HP EB SW BTO Professional Services)
30/04/2010

2009 HP Confidential

Agenda

HTML email setup


HTML Emails via standard Notification Engine: OOB functionality
Emails via Interaction or Incident: on demand (= Optional feature)

Setup & Requirements: what needs to be done ?

2009 HP Confidential

Introduction
With the functionality of the Email integration package for Service
Manager it is possible to send outbound Rich HTML emails from Service
Manager. The mechanism consists of user defined email templates
which can be used to send emails when a certain action in Service
Manager happens.
The installation package consists of several unload files and a Connect-It
scenario.

2009 HP Confidential

Flow
When a certain email generation event in Service Manager happens,
the template defined in the notifications-table will be used to construct
the message. The message is then temporarily stored in the eventouttable before it gets picked up by the Connect-It Scenario which runs
every minute.
The scenario transforms it in a HTML-message and transmits it to the
SMTP-server.
After the message is being sent, a copy is placed in the eventoutsenttable. In the case an error occurs, the message stays in the eventout-table till the next run of the scenario and the error message is added to
the record.

2009 HP Confidential

Why using this package ?


Rich Text formated mails are more visible attractive than default ASCII
formatted mails
Mail templates: easy composing and formatting (<-> default SM7
format mails)
Preview of template with ticket data

Uses standard Notification Engine


Multi-language support: when templates are available in the language
of the recipient (contact), localized templates will be used

Activate-deactivate templates on the fly


Available for all SM7s modules (even for Approvals)
Backup functionality of outgoing mails (seperate table and/or as
Historic Activity)
5

2009 HP Confidential

HTML mail examples

2009 HP Confidential

HTML mail examples

2009 HP Confidential

HTML mail examples

2009 HP Confidential

Components
Documentation
HTML mail menu
HTML Templates (limited number)
SM7 Notifications (limited number)

SM7 tables to support the setup (2 extra tables)


HP Connect-It scenario (connects to an SMTP server)
SM7 technical account -> SM7 LegacyIntegration Listener

SM7 ScriptLibrary : HTMLExportDone & HTMLTemplate


SM7 Event Registration and Event Maps: HTMLExportMailDone
SM7 Process: HTML.Export.Mail.Done
Web tier (common images used in HTML mail)
Send mail via interaction or incident (optional)
9

2009 HP Confidential

HTML mail menu

10

2009 HP Confidential

HTML Templates
A template is a record that is used to structure the format of the emails.
This email mechanism can be used for the following modules:

11

Interaction

Incident

Problem

Problem Tasks

Known Error

Known Error Task

Service Requests

Line Items

Orders

KM Document

2009 HP Confidential

HTML Templates

ACME

12

2009 HP Confidential

HTML Templates

13

2009 HP Confidential

HTML Templates

ACME

14

2009 HP Confidential

Notifications Definition
In the notification record the HTML templates are called via a JavaScript
ScriptLibrary function.
To construct the mail body the function
HTMLTemplates.getMailBody(.) has to be used. The function expects
the following parameters as input:

The name of the HTML template which has to be used

The record for which an email has to be sent

The save - record for which an email has to be sent (if not available, take the same as in 2.)

The recipient

The link to the affected record

An example call to the JavaScript-function when an interaction is


opened looks like this:
jscall("HTMLTemplates.getMailBody", "SM Add Mail Template", $L.file,
$L.file.save, callback.contact in $L.file,$L.web.url)
15

2009 HP Confidential

Notifications Definition
example

Body

Subject

16

2009 HP Confidential

SM7 tables to support the setup


1. Eventout
When the email is composed, the
message is temporarily stored in
the standard SM7 eventout table
until it is picked up by the
Connect-It scenario.

In case an error occurred while


sending the mail, the message
stays in the eventout table and the
error message is copied to the
errormessage field.

17

2009 HP Confidential

SM7 tables to support the setup


2. Eventoutsent
When a message is
successfully sent, a
copy is placed in
the eventoutsent
table, where it is
stored for future
reference.

18

2009 HP Confidential

SM7 tables to support the setup


3. HTMLTemplates
Contains all HTML
templates (see
above)

19

2009 HP Confidential

HP Connect-It scenario

20

2009 HP Confidential

HP Connect-It scenario
Detect HTML messages

This option enables you to send messages containing HTML tags. The
HTML code is interpreted and is not displayed in the source format for
the body of the e-mail.

21

2009 HP Confidential

ScriptLibrary: HTMLTemplates
Function 1 getMailBody
This function parses the template and returns an HTML String. Therefore the
recipient data is fetched from the table to determine the language of the contact
in order to select the appropriate template record. The sub function
parseTemplate() does the actual parsing of the template (replacing the
{RECORD.xxx}-directives with the actual data).
Function 2 getMailHeader
This function functions in a similar way as the getMailBody()-function, but only
the email-title (Subject) of the template record gets parsed.

22

2009 HP Confidential

Error Handling
ScriptLibrary: HTMLExportDone
After the mail is sent by Connect-IT to the SMTP-server. What happens:

A: The message is sent successfully: Via the HTMLExportDoneScriptLibrary record and the equally named EventMap the actions to
move the message record to the Eventoutsent-table are taken.
B: In case an error occurs: Via the same ScriptLibrary record and
EventMap the action to copy the SMTP-error message to the
errormessage- field is taken.
In the exportMailDone function the command to move the Eventoutrecord to the Eventoutsent-record or to fill in the errormessage-field is
executed based on the validation result of the mail sent action.
23

2009 HP Confidential

Error Handling
EventRegistration and Mappings HTMLExportMailDone
A new input event HTMLExportMailDone is registered in Service Manager to
define the actions that have to be done after an email has been sent. When this
event occurs, the process HTML.Export.Mail.Done is called to handle it.

Process HTML.Export.Mail.Done
The HTML.Export.Mail.Done process calls and passes the variables to the
exportMailDone- function.

24

2009 HP Confidential

System Information Record


Web Server information tab will be used to build the links in the emails:

25

2009 HP Confidential

OPTIONAL email functionality 1


Send an email directly from an
interaction or incident:

26

2009 HP Confidential

OPTIONAL email functionality 2a


Send an email directly from an
interaction or incident and keep a
copy in the Historic Activities.

27

2009 HP Confidential

OPTIONAL email functionality 2b

28

2009 HP Confidential

Q&A

29

2009 HP Confidential

You might also like