Skip to main content

Email setup

Updated over a month ago

There are three ways to configure sending emails from Coins ERP+: SMTP, SendGrid and Microsoft Graph API.

  • Generic.

  • SMTP.

  • SendGrid.

  • MS Graph.


Generic configuration

You need to set the following parameters:

SY/MAILFROM

Force email from single address

Whether to force all emails to be from a single email address (Yes or No).

If this is set to Yes, the email address in SY/REPEMAIL is used as the From: address for ALL emails sent, regardless of any other parameter settings or user preferences. This makes it easier for tight rules to be built around email security with regard to who is sending the email.

Note that this does NOT apply if using MSGraph to send emails as this specifically uses the user's Exchange account.

Related Parameter

  • SY/REPEMAIL - Email address COINS ERP+ reports sent from


SY/REPEMAIL

Email address COINS ERP+ reports sent from

The default email address that COINS uses as the From: address when emailing reports and other 'printed' output.

If SY/MAILFROM is not set to Yes, COINS uses the email address from the user record if possible, otherwise it uses the address specified by REPEMAIL.

Related Parameter

  • SY/MAILFROM - Force email from single address


SY/MAILFT

Mail Footer plain text

Text that is appended to the end of all text emails sent from COINS.

Related Parameter

  • SY/MAILFTH - Mail Footer HTML


SY/MAILFTH

Mail Footer HTML

Text in HTML format that is appended to the end of any HTML email sent using COINS.

HTML tags can be used in this parameter and it may be desirable to start the text with one or more <BR> to separate the footer from the text of the email.

Related Parameter

  • SY/MAILFT - Mail Footer plain text


SY/MAILHIST

Sent Emails history to retain (days)

How many days of sent email history to store.

If this is non-zero, all emails sent from COINS are logged for viewing in the Email History browse and are purged automatically after the specified number of days.

The value must be set globally - company level values are ignored.

SY/MAILMAX

Email Maximum Size (Bytes)

The maximum size allowed for emails.

If an email contains attachments that take it over the permitted size, the files are not attached, but the file names are listed in the email.

We recommend setting this below the size limit for your email client, and in any case an absolute maximum of 999999999 (that is, nine 9s) which would reflect a message size of 1Gb.


SY/WFMTXN

Workflow messages sent in transaction

Whether you are using the ESB Outbound Messages feature to send emails, SMS messages and workflow messages (Y or N).

Y = Messages will be queued and sent using the ESB Outbound Messages feature.

N = Messages will be sent immediately. Note that if the message is created during a transaction, and that transaction is cancelled, the message will still be sent.

Depending on the setting of the SY parameter MSGREV, this can be used to allow users to review messages before they are sent, or simply to keep a log of sent messages.

This assumes that the syuesb.p program is running. The syuesb.p program is the message broker that sends the ESB messages to the ESB and also the email and SMS messages to their respective servers.


SMTP

SMTP is the primary communication protocol used for sending email messages between servers.

You need to set the following parameters:

SY/MAILHOST

Email Server IP Address

The IP address of your email server.

SY/MAILPORT

Email Server Port

The port number of your email server.

Blank will default to Port 25. If another port is in use, enter that port.

SY/MAILUSER

SMTP User ID

The user ID for SMTP mail authorization.

SY/MAILPWD

SMTP Password

The password for SMTP mail authorization.

This applies if you are using an authenticated SMTP server. If you are not, COINS recommends entering a suitable dummy password (it will have no effect) as this will satisfy the security checker.

SY/MAILAUTH

SMTP Authorisation Method

The email authorization method.

Email authorization stops unauthenticated people from connecting to the email server. The options are No Authorization, SMTPAUTH (a standard authorization method for SMTP email) or SMTPAUTH2.


SendGrid API

SendGrid is a cloud-based email service that provides reliable email delivery, scalability, and real-time analytics. Coins ERP+ sends emails to PostFix which then relays the emails further on to Sendgrid.

You need to set the following parameters:

Parameter

Setting

MAILAUTH

SMTPAUTH2

MAILHOST

smtp.sendgrid.net

MAILPORT

587

MAILUSER

apikey

In addition, the MAILPWD parameter needs to be set to the password for PostFix.

SY/MAILAUTH

SMTP Authorisation Method

The email authorization method.

Email authorization stops unauthenticated people from connecting to the email server. The options are No Authorization, SMTPAUTH (a standard authorization method for SMTP email) or SMTPAUTH2.

SY/MAILHOST

Email Server IP Address

The IP address of your email server.

SY/MAILPORT

Email Server Port

The port number of your email server.

Blank will default to Port 25. If another port is in use, enter that port.

SY/MAILPWD

SMTP Password

The password for SMTP mail authorization.

This applies if you are using an authenticated SMTP server. If you are not, COINS recommends entering a suitable dummy password (it will have no effect) as this will satisfy the security checker.

SY/MAILUSER

SMTP User ID

The user ID for SMTP mail authorization.

My current understanding is that the following parameters were for an email adapter that is not currently used.

SY/EMAILADPTR

Email Adapter

Not currently used.

SY/SGRIDBEAR

Sendgrid Bearer Token

Not currently used.


Outlook integration using Microsoft Graph – configuration

Coins ERP+ can be integrated with Microsoft Outlook so that emails sent from Coins ERP+ are processed by Outlook, and tasks and appointments are synchronized between Coins ERP+ and Outlook.

To grant permissions for the system

  1. Create and configure the AAD App first.

  2. Grant admin consent. On the AAD Permissions screen, check the following permissions in the Required column:

    • Mail.Read and Mail.Send to allow emails to be sent.

    • Calendars.ReadWrite to allow synchronization of events and appointments.

    • Tasks.ReadWrite to allow synchronization of tasks.

    AAD Permissions screen

    For details of how to grant admin consent, see AAD Code Grant.

The next time you log in, these permissions are requested, and (if the permissions are granted) these are checked in the Grant column.

These are the permissions that are granted for the system as a whole. You also need to grant permissions to individual users.

If the App has been shared with other environments then the admin consent may already have been granted.

To check a user’s permissions

On the User Workbench AAD ID tab, the AAD Scope field lists the permissions that are granted to the user when they log in.

To test that AAD Graph is working, click the(Profile) button. The user’s profile displays in a separate window.

To enable email integration for a user

After a user has logged in using AAD, the MS Graph option appears on that user's User Workbench record.

  1. On the user record, go to the System > MS Graph tab.

  2. Click Open ().

  3. To let the user send emails using Outlook, check Emails.

  4. Click Save (Save Icon).

To enable appointment integration for a user

After a user has logged in using AAD, the MS Graph option appears on that user's User Workbench record.

  1. On the user record, go to the System > MS Graph tab.

  2. Click Open ().

  3. To allow appointments created in Coins ERP+ to be copied Outlook, check Synchronize Appointments.

  4. To also allow appointments created in Outlook to be copied to Coins ERP+, check New Outlook to Coins ERP+.

    Appointments in Outlook will be copied if the first category on the appointment matches the description of an action type in your default Coins ERP+ company.

  5. Click Save (Save Icon).

  6. To synchronize appointments immediately, click the corresponding REFRESH button. If you don’t do this, appointments will be synchronized when sy906b.p runs (which is usually overnight).

    The screen shows details of the synchronization.

    Field

    Description

    Subscription ID

    The ID to the subscribed webhook in Outlook. This means that any changes made in Outlook are alerted near real time with COINS. You can delete the subscription using the Delete button, and reset it with the Refresh button which does another full sync. A full resync is done each time sy906b.p is run overnight.

    State

    A secret that the Outlook webhook must provide for the webhook post to be actioned.

    Expires

    The time at which the subscription expires. This is 48 hours from the time the refresh is run. This is refreshed every night when sy906b.p is run.

    Delta URL

    The URL that will be used to retrieve the next set of changes. It will change as each change is made and processed in Outlook.

    Only appointments that are within the date range determined by the SY parameters MSEVBACK and MSEVFWD are synchronized.

To enable task integration for a user

  1. In each company that will receive tasks from Outlook, create an action type for those tasks, and enter it as the value of SY/MSACTTYP.

  2. In the user’s Outlook account, create a task list folder that corresponds to the value of SY/MSLINAME (for example, COINS).

  3. On the user record, go to the System > MS Graph tab.

  4. Click Open ().

  5. To allow tasks created in Coins ERP+ to be copied to Outlook, check Synchronize Tasks.

  6. To also allow tasks created in Outlook to be copied to Coins ERP+, check New Outlook to Coins ERP+.

    If you have set up the list correctly, the screen shows a List ID for it.

  7. Click Save (Save Icon).

  8. To synchronize tasks immediately, click the corresponding REFRESH button. If you don’t do this, tasks will be synchronized when sy906b.p runs (which is usually overnight).

Monitoring changes

For normal running, ensure that the background task that services the MSGRAPH endpoints (.PULL and .PUSH) is running.

Changes in Coins ERP+ and changes in Outlook can be seen passing through the ESB (most easily done if the ESB send process for MSGRAPH endpoint is stopped).

With the MSGRAPH endpoint stopped, changes made in Coins ERP+ and Outlook show up as messages.

ESB Outbound Message Screen

Changes in Coins ERP+ show as PUSH with an UPDATE (or CREATE or DELETE) and a kco and hsa_ref key.

Changes in Outlook show as PULL with MSEVENT source and the subscription ID (from the user MS graph tab) as the key.

Restarting the MSGRAPH endpoint will process the changes, and they are then reflected in the Activity Workbench and Outlook.

Parameters

SY/MSACTTYP

MS Task Action Type

The action type to assign to tasks that are created in Outlook and are then created in COINS. This action type needs to be created in each company that will receive tasks from Outlook. Tasks are created in the default company for a user.

If you change this parameter, ensure that the application server and graph server agents are restarted for it to take effect.

Action types are set up using Action Types.

SY/MSEVBACK

MS Event Days Backwards

The number of days backwards that events in Outlook and COINS Appointments will be synchronized. This is a positive number, so 1 means yesterday. Expected values are 1 or perhaps 7 for last week. Changes to appointment or events before this date will ignored.

SY/MSEVFWD

MS Event Day Forwards

The number of days forwards that events in Outlook and COINS Appointments will be synchronized. This is a positive number, so 7 means the coming seven days. A typical value is 21 for the next three weeks. Changes to appointments or events after this date will ignored.

SY/MSLINAME

MS Task List Name

The name of the Task list in Outlook that will be synchronized with the tasks in COINS. If the list does not exist for the user, they will not be able to synchronize tasks.

SY/WEBHOOK

Webhook URL

The URL to register and action webhook POSTs from MSGraph. Typically it will be the URL with wohook.p; for example:

It would be possible to configure an apache redirect or proxy on a different server (to separate out this interface if required), in which case the proxy URL would be used and would redirect to the wohook.p URL above.

Did this answer your question?