Example of Customer Portal Integration

You can integrate Allegra into your website. There are two possibilities: direct connection of the Allegra server, so that your clients can follow the processing status of their messages directly on your website, or via email, without the client being able to track their items via the website.

Connection with tracking of own items

In order to submit and query messages, the users must first authenticate themselves. For this purpose, they can register with the system or simply enter their email address.

After logging in, the users see the list of their messages, including the recent closed ones. They can also submit new messages.

The integration into their own website naturally depends on the CMS used. Also, the design of the user interface depends on your corporate design and the CMS used.

You can download an implementation example for a website integration from the download workspace. It is based on PHP, JQuery, and Bootstrap. The integration into a Contao CMS with support for the English and German language could look like this:

{{iflng::en}} <iframe src="/service-desk/index-en.php" width="100%" height="600px"/> {{iflng}}
{{ifnlng::en}} <iframe src=/service-desk/index-en.php width="100%" height="600px"/> {{ifnlng}}

In the index-en.php and index-en.php files, you must specify the address of your Allegra REST interface. You must also ensure that Web Services are active on your Allegra server.

<?php // insert your server access here
   $SERVER_BASE_URL = "https://www.yourserver.com/track/rest";
   $THEME = "custom"; // [custom | default]
   // style sheet for custom is in "resources/custom-style.css"
   // Available locales: en_US, de_DE $PAGE_LANG = "de_DE";
   // Leave path empty if no logo should be shown
   $NAVBAR_COMPANY_LOGO_SRC = ""; ... ``

Connection without traceability of own items

If your customers do not need to be able to view the current processing status of the cases they have submitted, connecting the Allegra server to your website via email offers the security advantage that you do not have to open an additional system to the outside world.

For this purpose, you provide an appropriate contact form, whose content you then send via email to the corresponding receiving address of your Allegra server.

It is possible to easily fill in the email data in the Allegra system by formatting the email accordingly. To do this, proceed as follows:

Add the following Groovy script with the type “Workflow Activity Script” to the scripts. If you do not use workflows, name the script “EmailActivityScript”. If you include the script in workflows, we recommend you use a different name, e.g., “EmailWfActivityScript”.

import java.util.Locale;
import java.util.Map;
import com.aurel.track.beans.TPersonBean;
import com.aurel.track.beans.TWorkItemBean;
import com.aurel.track.fieldType.runtime.base.WorkItemContext;
import com.aurel.track.util.emailHandling.EmailJSONUtil;
import com.aurel.track.admin.customize.scripting.BINDING_PARAMS;

public class EmailActivityScript { // "EmailWfActivityScript" when used in workflows

   public Map<String, Object> handleEvent(Map<String, Object> inputBinding) {
      WorkItemContext workItemContext = (WorkItemContext) inputBinding.get(BINDING_PARAMS.WORKITEM_CONTEXT);
      String body = (String) inputBinding.get(BINDING_PARAMS.EMAIL_BODY);
      if (body == null) {
         return inputBinding;
      }
      TPersonBean senderUser = (TPersonBean) inputBinding.get(BINDING_PARAMS.USER);
      if (senderUser == null) {
         return inputBinding;
      }
      Locale locale = (Locale) inputBinding.get(BINDING_PARAMS.LOCALE);
      String fromAddress = (String) inputBinding.get(BINDING_PARAMS.EMAIL_FROM_ADDRESS);
      if (fromAddress != null && fromAddress.equals("info@yourdomain.com")) { // match
         EmailJSONUtil.updateItem(workItemContext, body, senderUser, locale);
      }
      return inputBinding;
   }
}

The body of the email must be a valid JSON object. The attributes of the object will then become the attributes of the new item to be created.

{"attributename1": "attributevalue1", "attributename2": "attributevalue2", "..." }

Example:

{
   "build": "5.2.4",
   "Description": "Some decription of the problem",
   "EndDate":"2017-09-12",
   "ItemType": "Requirement",
   "Manager": "Guest, John",
   "StartDate":"2017-09-10",
   "Status": "analyzed",
   "Synopsis": "Title of problem",
   "Shorttext": "A custom field here",
   "CustomSimpleSelect": "g1",
   "CustomInteger":3,
   "CustomDouble":7.0
}

For attribute names, take the original attribute names. You can use localized attribute names, if the sender of the email (i.e. your website form) is known as a user in your system and has a preferred language.