Announcement

Collapse
No announcement yet.

Outlook Integration - Syncing more fields: location, body, etc.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Outlook Integration - Syncing more fields: location, body, etc.

    Summary: Is it possible to sync more fields to an Outlook meeting?

    I created a custom Event entity called Session, which is for a healthcare business. The session takes place at multiple locations and it changes from day to day. The providers use Outlook to get directions, check notes, and many other things because the Outlook app is more convenient than using a CRM in this case. That's not an issue because the Outlook extension works extremely well. However, I can't figure out how to sync more fields to the meetings, which means my users often need to go to the CRM, which takes longer.

    I tried to fix this by appending the name of the location to the title of the synced event, e.g. "<Client name> (<Location>)", but <Location> is only a word, such as Home, Daycare, or School. Being able to send a link to the location, such as a Google Maps link, would massively improve our workflow. Being able to put information in the body of the event would be similarly helpful.

  • #2
    Ok, I partially answered my own question, but I still need help.

    It is possible to send more information by using the description field. Here is the relevant snippet:
    PHP Code:
    if ($entity->get('description')) {
       
    $item['Body'] = [
         
    'ContentType' => 'Text',
         
    'Content' => $entity->get('description'),
       ];
     } 
    Outlook can handle Text or HTML ContentTypes, but Text is fine for most things.

    The Microsoft Graph API document for creating a calendar event is here. The documentation for the event resource type, which is what a calendar event is, can be found here. In short, notice the property called location; that's what has to be set, which I verified by modifying the extension's code.

    It is possible to customize a paid extension? I do not want to modify the code in application/.

    Comment


    • #3
      Hi bandtank,

      we have developed an integration for meetings, tasks and contacts.
      This solution needs some additional fields in Espo and formulas (before - after save). If you are interested in this solution, please write me a PM.
      The solution was round about three month of development, so this won't be for free.

      A Python script synchronizes EspoCRM contacts, tasks and appointments with Outlook.
      The script compares all objects with each other and creates, deletes or updates the changed data accordingly.
      The synchronization of contacts and appointments is one-way. This means that changed data in Outlook will be overwritten.
      For the tasks, the status will also be changed to Espo if it has changed to Exchange. All other
      Task fields are overwritten. Objects created manually in Outlook (e.g. appointments) are ignored and not
      changed or deleted.


      The program is available as Debian package (others should be possible)​, works with webhooks (e.g. every 2 minutes) checks all every hour, different options to configure:

      EWS_SERVER - The server address of the Exchange server. For Office 365 it is: outlook.office365.com
      EWS_CLIENT_ID - The application ID of the app registration in Azure.
      EWS_CLIENT_SECRET - The value of a client secret for Azure app registration.
      EWS_TENANT_ID - The directory ID of the app registration in Azure.
      EWS_SUB_FOLDER - Outlook subfolder of the respective entity. Enter None here for no subfolders.
      ⚠ The primary calendar is always used for appointments, otherwise the invitations will not be correct
      function.
      EWS_CREATE_SUB_FOLDER_IF_NOT_EXISTS - Determines whether to create the subfolders if they are not already
      exist.
      EWS_CALENDER_TARGETS - The email addresses of the users whose primary calendar is to be used.
      ESPO_HOST - The domain or IP address of the Espo server.
      ESPO_PORT - The port of the Espo server. Enter None here for the standard port.
      ESPO_HTTPS - Use either https or http for transfer.
      ESPO_CERTIFICATE_VERIFY - Should the https certificate be verified or not. With http connections, this setting has no effect.
      ESPO_API_KEY - The API key of the API user. This can be copied from the Espo web interface.
      LOG_LEVEL - Log level for console and main.log file. Possible: DEBUG, INFO, WARNING, ERROR.
      IGNORE_MEETINGS_OLDER_THEN - Appointments that start more than x days in the past will be ignored.
      MEETINGS_SYNC_START_DATE - Appointments that start before this date are ignored.

      We created a custom job /var/www/crm/custom/Espo/Custom/Jobs/O365sync.php

      ​Meetings
      We also developed this for a group calendar which sends the invitations and holds the meetings. This must be a full Office 365 account.
      If a multi-day meeting has a time, this is created as a series appointment in Outlook. In all other cases (e.g. "All day" is set as the time or for one-day meetings), then
      this meeting is created as a normal appointment.

      The following must be observed:

      If a meeting also takes place at the weekend, the option "Include weekend" (user-defined field (bool)) must be activated.
      By default, weekend days are skipped. If an appointment that is part of a series is changed in Outlook, this change is not recognized and accordingly not repaired. This only happens when the original meeting is changed to Espo. The end time of a meeting cannot be earlier than the start time. Neither for one-day nor for multi-day meetings.

      tasks
      If an Espo task has only a start date but no due date, this task will be updated every time. (The reason for this is unknown)​​

      Comment

      Working...
      X