Track Email Message Exchanges Between Salespeople and Contacts

Get more out of the communications between your salespeople and customers by turning email exchanges into actionable opportunities. Business Central can work with Exchange Online to keep a log of the inbound and outbound messages. You can view and analyse the contents of each message on the Interaction Log Entries page.

Note

In 2022 release wave 1 we've streamlined processes for setting up email logging to increase flexibility and security. If you are a new customer using that version, you're using the new experience. If you're an existing customer, whether you are using the new experience depends on whether your administrator has enabled the the Email logging using the Microsoft Graph API feature update in Feature Management. For more information, see Enabling Upcoming Features Ahead of Time.

Important

For Business Central online, the new experience requires that Business Central and Exchange Online are on the same tenant.

To set up email logging

These steps differ, depending on whether your administrator has turned on the Email logging using the Microsoft Graph API feature update. If the feature update isn't turned on, follow the steps on the Current Experience tab.

Set up Public Folders and Rules for Email Logging in Exchange Online

Note

The following sections assume that you have administrator access for Exchange Online.

Before you can set up email logging, you must prepare Office 365 public folders. You can do this in the Exchange admin centre, or you can use the Exchange Online PowerShell.

Tip

If you want to use the Exchange Online PowerShell, you can find inspiration for how to set up your script in a sample script that we published in the BCTech repo.

Follow the steps below to set up Exchange Online, with links to where you can learn more.

Create an admin role group

Create an admin role group for public folders based on the information in the following table:

Property Value
Name Public Folders Management
Selected roles Public Folders
Selected users The email of the user account that Business Central will use to run the email logging job

For more information, see Manage role groups in Exchange Online.

Create a new public folder mailbox

Create a new public folder mailbox based on the information in the following table:

Property Value
Name Public MailBox

For more information, see Create a public folder mailbox.

Create new public folders

  1. Create a new public folder with the name Email Logging in the root so that the full path to the folder becomes \Email Logging\.

  2. Create two sub-folders so that the the result is the following full paths to the folders:

    • \Email Logging\Queue\
    • \Email Logging\Storage\

For more information, see Create a public folder.

Set public folder ownership

Set the email logging user as an owner of both public folders, Queue and Storage.

For more information, see Assign permissions to the public folder.

Mail-enable the Queue public folder

For more information, see Mail-enable or mail-disable a public folder.

Mail-enable sending emails to the Queue public folder

Mail-enable sending emails to the Queue public folder using Outlook or the Exchange Management Shell.

For more information, see Allow anonymous users to send email to a mail-enabled public folder.

Create mail flow rules

Create two mail flow rules based on the information in the following table:

Purpose Name Apply this rule if... Do the following...
A rule for incoming email Log Email Sent to This Organisation The sender is located Outside the organisation, and the recipient is located Inside the organisation BCC the email account that is specified for the Queue public folder
A rule for outgoing email Log Email Sent from This Organisation The sender is located Inside the organisation, and the recipient is located Outside the organisation BCC the email account that is specified for the Queue public folder

For more information, see Manage mail flow rules in Exchange Online and Mail flow rule actions in Exchange Online.

Note

If you make changes in the Exchange Management Shell, the changes become visible in the Exchange admin centre after a delay. Also, the changes made in Exchange will be available in Business Central after a delay. The delay might be several hours.

Next, you connect Business Central with Exchange Online.

Set Up Business Central to Log Email Messages

These steps are the same for both the current and new experiences.

Get started with email logging in two easy steps:

  1. Connect Business Central with Exchange Online for your Microsoft 365 subscription. Exchange Online handles your email messages. We've made this step easy by providing an assisted setup guide. You just need your administrator credentials for your administrator account in Microsoft 365. To start the guide, go to the Assisted Setup page, and then select the Set up email logging guide.

  2. Make sure that the email addresses for your sales people and contacts in Business Central are valid. To do that, for each customer or salesperson, open the Contact or Salesperson/Purchaser card and have a look in the Email field.

Tip

After you complete the steps in the guide you can check whether the connection was successful. Depending on whether you're using the current or new exerience, do one of the following steps:

  • Current experience: Search for Marketing Setup, choose Access, then Functions, and then Validate Email Logging Setup.
  • New experience: Search for Email Logging, choose Actions, and then choose Validate Setup.

Viewing Email Message Exchanges in the Interaction Log

Business Central creates an entry on the Interaction Log page each time a salesperson and a contact exchange an email message. To view the interaction log, open the Contact card for the person, choose Related, then History, and then Interaction Log Entries. There are a few things you can do with each entry in the log, for example:

  • View the content of the email message that was exchanged by selecting Process and then Show Attachments.
  • Turn an email exchange into a sales opportunity. If an entry looks promising, you can turn it into an opportunity and then manage its progress toward a sale. To turn an email exchange into an opportunity, choose the entry, then Process, and then Create Opportunity. For more information, see Managing Sales Opportunities.

Mailbox and folder limits in Exchange Online

There are mailbox and folder limits in Exchange Online, such as limits for folder sizes and the number of messages. For more information, see Exchange Online limits and Limits for public folders in Exchange Server.

Business Central stores logged email messages in a folder in Exchange Online. Business Central also stores a link to each logged message. The links open the logged messages in Exchange Online from the Interaction Log Entries, Contact Card, and Salespersons Card pages in Business Central. If a logged message is moved to another folder, the link will be broken. For example, a message might be moved manually, or Exchange Online might automatically start AutoSplit when a storage limit is reached.

The following steps can help you avoid breaking links to messages in Exchange Online.

  1. Don't move existing messages to another folder after you change settings for your email logging setup. Keeping existing messages where they are will preserve the links. Links to messages in the new folder will be valid.
  2. Avoid reaching the mailbox and folder limits. If you're about to reach a limit, take the following steps:
    1. Set up a new shared mailbox (new experience) or a new shared folder (current experience) in Exchange Online.
    2. Update your email flow rules in Exchange Online.
    3. Update your email logging setup in Business Central accordingly

Connect On-Premises Versions to Microsoft Exchange

You can connect Business Central on-premises to Exchange on-premises or Exchange Online for email logging. For both versions of Exchange, settings for the connection are available on the Marketing Setup page. For Exchange Online, you can also use an assisted setup guide.

Important

The new experience doesn't support a connection to Exchange on-premises. If you must use Exchange on-premises, do not enable the feature update for the new experience.

Connect to Exchange On-Premises

To connect Business Central on-premises to Exchange on-premises, on the Marketing Setup page, you can use Basic as the Authentication Type, and then enter credentials for the user account for Exchange on-premises. Then turn on the Enabled toggle to start logging email.

Connect to Exchange Online

To connect to Exchange Online you must register an application in Azure Active Directory. Provide the application ID, key vault secret, and the redirect URL to use for the registration. The redirect URL is pre-set and should work for most installations. For more information, see To register an application in Azure AD for connecting from Business Central to Exchange Online.

You must also use OAuth2 as the Authentication Type. You must also register an application in Azure Active Directory. Provide the application ID, key vault secret, and the redirect URL to use for the registration. The redirect URL is pre-populated and should work for most installations. For more information, see To register an application in Azure AD for connecting from Business Central to Exchange Online below.

You must set up your installation to use HTTPS. For more information, see Configuring SSL to Secure the Business Central Web Client Connection. If you're setting up your server to have a different home page, you can change the URL. The client secret will be saved as an encrypted string in your database.

To register an application in Azure AD for connecting from Business Central to Exchange Online

The following steps assume that you use Azure Active Directory to manage identities and access. For more information, see Quickstart: Register an application with the Microsoft identity platform.

The following steps assume that you use Azure Active Directory to manage identities and access. For more information, see Quickstart: Register an application with the Microsoft identity platform. If you do not use Azure Active Directory, see Use Another Identity and Access Management Service.

  1. In the Azure Portal, under Manage, choose Authentication.

  2. Under Redirect URL, add the redirect URL that is suggested on the Marketing Setup page in Business Central. If the redirect URL on the Marketing Setup page is empty, find the suggested redirect URL on the Email Logging Assisted Setup page.

    Note

    If you do not specify the redirect URL, you can do so later by choosing Add a platform, and then choosing Web to add the web application and the redirect URL.

  3. Under Manage, choose Manifest.

  4. Locate the requiredResourceAccess property in the manifest, and add the following code in the brackets ([]) to add the required permissions. For more information, see Register your application.

{
    "resourceAppId": "00000002-0000-0ff1-ce00-000000000000",
    "resourceAccess": [
        {
            "id": "3b5f3d61-589b-4a3c-a359-5dd4b5ee5bd5",
            "type": "Scope"
        },
        {
            "id": "dc890d15-9560-4a4c-9b7f-a736ec74ec40",
            "type": "Role"
        }
    ]
}
  1. Choose Save.

  2. Under Manage, choose API permissions, and then confirm that the following permissions are listed:

    • EWS.AccessAsUser.All
    • full_access_as_app
  3. Under Manage, choose Certificates & Secrets, and then create a new secret for your app. You'll use the secret either in Business Central, in the Client Secret field on the Marketing Setup page, or store it in secure storage and provide it in an event subscriber.

  4. Choose Overview, and then find the Application (client) ID value. The Application (client) ID value is the client ID of your application. You must enter the client ID either on the Marketing Setup page, in the Client ID field, or store it in secure storage and provide it in an event subscriber.

  5. In Business Central, set up email logging on the Marketing Setup page, or use the Email Logging Assisted Setup guide for assistance with the process.

    • Provide the email account of the user on behalf of whom the scheduled job will connect to Exchange Online and process emails. The user must have a valid licence for Exchange Online.
    • Provide the URL for your Exchange Online. Typically, this URL is the domain that you specified in the user's email address.
    • Provide the Queue Folder Path and Storage Folder Path.
  6. To start logging email, turn on the Enabled toggle.

  7. Sign in with your administrator account for Azure Active Directory (this account must have a valid licence for Exchange and be an administrator in your Exchange Online). After you sign in, you must allow your registered application to sign in to Exchange Online on behalf of the organisation. You must give consent to complete the setup.

Note

If you are not prompted to sign in with your administrator account, it might be because pop ups are blocked. To sign in, allow pop-ups from https://login.microsoftonline.com.

To start logging email

  1. To start logging email, on the Email Logging page, turn on the Enabled toggle.

  2. Sign in with the Exchange Online account that the scheduled job will use to connect to the shared mailbox and process emails.

    Note

    If you are not prompted to sign in the the Exchange Online account, it might be because your browser is blocking pop-ups. To sign in, allow pop-ups from https://login.microsoftonline.com.

To stop logging email

  1. Choose the Lightbulb that opens the Tell Me feature. icon, enter Marketing Setup, and then choose the related link.
  2. Turn off the Enabled toggle.

To change the user account used for email logging

If you are using the new experience, you can change the user account used for email logging. The current experience doesn't support this.

Disable your current setup, change the user on the Email Logging page, and then re-enable email logging. You can also run the assisted setup guide again.