IdeaLayer Engine can be configured to send email through an SMTP server and email account of your choosing. This enables you to send emails with attached files through the Collab mode and other custom Showcase apps.
A template configuration is found in the Engine configuration file. You can uncomment the options already there and fill-in the relevant email server details. See below for a minimal example.
## Login and message details for the e-mailer EMAILER_SERVER = smtp://smtp.example.org EMAILER_USERNAME = username EMAILER_PASSWORD = password EMAILER_SENDER = sender@example.org EMAILER_SENDER_DISPLAY_NAME = Example Organisation EMAILER_SSL_CONNECTION_TYPE = 0 # Values: 0 (SSL for all communication or fail - default); 1 (try using SSL, proceed anyway otherwise); 2 (do not attempt to use SSL) #EMAILER_USE_REPLY_TO = 1 # On by default. Reply-To header based on selected profile's details. Will fail if no name/email address for the profile is set. #EMAILER_USE_MAIL_FROM = 1 # On by default. Will enable the mail From: initial header to be set by Curl (it's value matches EMAILER_SENDER) #EMAILER_USE_GLOBAL_SENDER_NAME = 0 # Off by default. If enabled, always send email from the EMAILER_SENDER, despite which sender profile is selected. Normally this is used in conjunction with EMAILER_USE_REPLY_TO set to 1. Depending on the email server, this may be required to prevent the email being detected as spam. #EMAILER_CC += cc1@example.org #EMAILER_CC += cc2@example.org #EMAILER_SUBJECT = Subject #EMAILER_HTML_FILE = template.html #relative to the 'emailer' folder in the IdeaLayer Engine configuration folder
You can optionally configure multiple email addresses to be added as CC recipients (EMAILER_CC), as well as a custom subject line (EMAILER_SUBJECT). TheĀ EMAILER_HTML_FILE points to a file (in the 'emailer' folder in your Engine configuration folder, i.e. C:\ProgramData\IdeaLayer Engine) which can be edited to change the default contents of the email. If you do wish to make changes to this, it is recommended that you duplicate the existing file and give it a unique name (e.g. myemailtemplate.html), and update the EMAILER_HTML_FILE setting to point to this file.
Another example is shown below, which sends through Gmail, and specifies which port to use when connecting to the server. You may need to vary theĀ EMAILER_SSL_CONNECTION_TYPE depending on the server configuration. Commonly you would set this to either 0 or 1.
## Login and message details for the e-mailer EMAILER_SERVER = smtp://smtp.gmail.com:587 EMAILER_USERNAME = john.smith@gmail.com EMAILER_PASSWORD = password EMAILER_SENDER = example@gmail.com EMAILER_SENDER_DISPLAY_NAME = John Smith EMAILER_SSL_CONNECTION_TYPE = 1 # Values: 0 (SSL for all communication or fail - default); 1 (try using SSL, proceed anyway otherwise); 2 (do not attempt to use SSL)
Email profiles can be setup which enable the emailer to change the signature and reply-to address for the email. For example, an app used in a retail setting could enable the sales staff to select who the email should appear to come from, with the signature and reply-to address set appropriated. The profiles can be configured with the following settings:
#Emailer sender profile settings (for custom signatures and reply-to address) #These are relative to the 'emailer' folder in the Engine configuration folder (the EMAILER_PROFILE points to a folder name containing a signature.html file) EMAILER_PROFILE += defaultsender EMAILER_NAME += Default EMAILER_ADDRESS += sender@example.org
EMAILER_PROFILE points to a folder which contains a signature.html file. You can edit this file to control what signature content is inserted in the email, when the user selects to send email using this profile.
To add an additional profile(s), you can list the same group of options again but with different settings. To create the profile, you can duplicate the existing defaultsender folder (in the email folder), and rename the folder to match the name of the EMAILER_PROFILE setting. In the example below, a folder called johnsmith would be created alongside the existing defaultsender folder. That folder would have a custom signature.html file for John Smith.
EMAILER_PROFILE += johnsmith EMAILER_NAME += John Smith EMAILER_ADDRESS += john.smith@gmail.com
If you create custom email profile folders, it is recommended that you back-up these folders elsewhere so that they can be restored if necessary when reinstalling Engine or performing upgrades.