Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

To set up an incoming mail configuration, navigate to the Integrations → Incoming Mail page in the Power Apps Config page.

...

Here you can Clicking on the Add configuration allows you to set up a single (for now) Incoming mail configuration. This configuration will process incoming emails and execute the designated SIL script.

Parameters

The required fields for setup are as follows:

  • Protocol
    The selected value must correspond to the enabled protocol on the mail server. Currently, POP3 and IMAP are supported.

  • Mail Host
    This should contain the server’s hostname or its IP address (e.g. imap.gmail.com)

  • Port
    This indicates the port on which the server is listening. It is pre-filled with the default value of the port for the selected Protocol.

  • User Mailbox

    Please enter the account username to which you want this configuration to connect (e.g. mygmailacc@gmailtestincomingemail@gmail.com).

  • Password
    This contains the password that will be used to set up the connection. It is not the actual mail password but, for Gmail, for example, it is the generated App password.

  • Script
    Choose the SIL script that you wish to run each time a new incoming email is captured. Make use of the purpose-built Incoming Mail Processing Functions available within the SIL script to achieve your processing objectives.

  • Mail check interval
    Set the frequency in minutes for checking new messages in your mailbox.

  • Maximum message size
    To prevent processing failures resulting from out-of-memory errors, it's important to set a maximum file size limit in megabytes. Any emails exceeding the limit will not undergo processing.

  • Delete processed emails
    Enable this toggle to instruct the mail server to delete the emails once they are processed.

...

The processing results will be displayed in the Processing history table below, which retains the latest 10 outcomes.

Script example

Here is a sample script that can be used in an Incoming mail configuration to create a new issue every time a new email is received, meeting the following specifications:

  • the subject of the email contains the name of a project;

  • the body of the email will serve as the new issue’s description;

  • the reporter of the newly created issue will be the extracted from the email’s From field;

  • the watchers for the newly created issue will be extracted from the email’s CC.

Code Block
IncomingEmail mail = getIncomingEmail();

string projectKey = getProjectKeyByName(mail.subject);
string[] fields = {};
fields += {"reporter", getUserByEmail(mail.from).key};
fields += {"watchers", getUserKeysFromEmails(mail.cc)};
createIssue(projectKey, "", "Task", "Created via Incoming mail script", "Minor", mail.body, {}, "", "", fields);

For more information regarding the IncomingEmail SIL structure and other useful email functions, visit this page: https://appfire.atlassian.net/wiki/spaces/PSJC/pages/999162356/Incoming+Mail+Processing+Functions#IncomingMail