Skip to main content

Email Service

Sabre Red 360 Developer Toolkit provides a capability for editing and sending email messages with an E-mail Composer editor, which Sabre Red 360 provides.

Dependencies and classes

Below you can find a list of required dependencies   and classes.

Minimal Required Dependency

  • com.sabre.edge.platform.optional.agenttask.email

  • com.sabre.edge.cf.core

  • com.sabre.edge.cf.model

Usage

To be able to use EmailService you have to add the authorization entry to your redapp.xml file in <RedApp></RedApp> section:

<Authorization name="com.sabre.edge.platform.optional.agenttask.email.EmailService" threshold="[threshold]" metric="[metric]" />

The following code snippet demonstrates opening an E-mail Composer editor with pre-populated fields basing on a message object.

Message message = new Message();
message.setFrom("sender@sabre.com");
message.setTo(Arrays.asList(new String[]{"recipient@sabre.com"}));
message.setSubject("Sample subject");
message.setBody("<ul><li>item 1</li><li>item 2</li><li><strong>item 3</strong></li></ul><p><span style=\"color: #ff0000\"><span style=\"font-family: comic sans ms,cursive\"><span style=\"font-size: 14px\">Sample text</span></span></span></p>");

ISRWCommunication communication = Activator.getDefault().getServiceReference(ISRWCommunication.class);
EmailServiceClient emailService = new EmailServiceClient(communication);
emailService.send(message);

The E-mail Composer editor displays this e-mail as follows:

image9

NOTE:

  • If the field from is empty or null, its value is retrieved from Agent’s Preferences.

  • Fields from, to and subject are obligatory, and a user will be forced to complete them before sending an email (see the screen below).

image10

Additional Resources for Email Service

The Sabre Red 360 Developer Toolkit includes the com.sabre.redapp.example.cf.email sample plug-in.