Versions Compared

Key

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

Insert excerpt
_Banners
_Banners
namescreenanalysis
nopaneltrue

This page is for application designers who want to send notifications via email.

Contents

Overview

Emails are sent using

Table of Contents
exclude^Contents$|^Overview$|^Learn More$

Overview

To send email notifications to application users, configure a File Exporter which . This allows you to email information about data in PhixFlow and optionally to add a file as an attachment.

Email Accounts Setup

In order to send an email from emails, PhixFlow you must setup have an Email Account to send the emails from.

In the Repository, navigate

 from which to send emails. Email accounts are configured for the whole PhixFlow instance rather than in an application. This means you need administrator privileges to create an account.

Step 1  Create an Email Account

If there is no PhixFlow email account, ask your PhixFlow administrator to create one. If you are using a PhixFlow hosted instance, email support@phixflow.com. Also ask for permission to edit the account.

Step 2  Configure the Email Account

  1. In the repository, go to Full RepositoryEmail Accounts
  2. If you have an account setup double click on it and the following screen will open:
  3. . 
  4. Double-click the account name to open its properties.Image Modified
  5. Make a note of the Login name .
  6. If do not have an email account that can be used to send notifications:
    1. Contact your IT Team to setup an account that can be used to send notifications. 
    2. If you are using a PhixFlow hosted instance contact PhixFlow support to set this up for you.
    3. Now, enter the email account details as detailed in Email Account.

Testing the Account

To test the email account you wish to use:

  1. Open the Email Account in PhixFlow.
  2. Enter your email address in the Test To: box.
  3. From the more menu at the top of the properties, click as you will need to know it when testing.
  4. Configure the email account as required; see Email Account properties for details of the options. Set
    • Outbound: tick
    • Enabled: tick
  5. Save your changes.

Step 3  Test the Email Account

  1. Reopen the email account.
  2. In Test To enter your email address.
    If the Test To option is not visible, make sure Outbound is ticked.
  3. In the properties toolbar, click
    Insert excerpt
    _more_options
    _more_options
    nopaneltrue
     and select 
    Insert excerpt
    _emailConfiguration
    _emailConfiguration
    nopaneltrue
    .
  4. PhixFlow sends an email to the address specified in Test to.
  5. You should now receive Check your email. There should be an email address from the emal account's Login address setup on your Email Account. For , for example notifications@phixflow.com.

Sending an Email

You may want to add an attachment to an email. 

In this example, we will send an email with an attachment that contains a list of processed employees for a particular day. This data is available from the downloads section of our

Tip

You can download the example data from the PhixFlow Learning Centre

Setup the

Step 1  Create an Analysis Model to Generate the Attachment

  1. Create an analysis model or open one that contains the required data; see Analysis Models and Exporting to a File.
  2. Add a the table which that contains the data you wish to export as an attachment.Note in this example I have created a second table, Send Email, that is used only to send the email and will not affect the static Employees table that imports the data. Separating the data like this gives us want to export. Hover your mouse pointer over the table and in the popup toolbar, click 
    Insert excerpt
    _static
    _static
    nopaneltrue
    . This means the data remains unaffected when you run the analysis model.
  3. Add a second table called Send Email. This separates the data from generating the email, which gives you more control over the different tasks. 

  4. From the Toolbar analysis model toolbar drag in
    Insert excerpt
    _file_exporter
    _file_exporter
    nopaneltrue
     onto the canvas.
  5. Connect the Table table Employees to the File Exporterfile exporter. This pipe will be used to run the File Exporter laterfile exporter when you run analysis.
  6. Connect the Table to the File Exporter table Employees to the file exporter a second time. This will be used to count the records later.In the pipe properties which open for the second connectionPhixFlow opens the pipe properties.
  7. To configure the second pipe to count the records, set:
    • Name
    ,
    • : recs.
    • Type
    ,
    • : select Look-up.
    • Save your changes.
      Your
    setup
    • model should look
    lie the following:
    • like this.
      Image Modified
    Click

Step 2  Configure the File Exporter

  1. In the analysis model, click on the 
    Insert excerpt
    _file_exporter
    _file_exporter
    nopaneltrue
     to open its properties:.
  2. In Basic Settings, set:
    • Name
    , indicative
    • : to indicate the purpose of the email
    being sent
    • .
    • Enabled
    ,
    • : ticked. 
    This enables the file to be exported and email to be sent. Typically this is only

    • Leave this unticked during testing to avoid generating lots of data and emails then tick it when you are ready for the file to be exported and emails to be sent. 
    • File Name
    , is
    • : specify the name
    given to
    • for the exported file
    , it is an expression field. See Expressions and PhixScripts. The
    • . The file extension
    should
    • must match the type of data being exported.
      • For a simple
    file names, encapsulate the desired
      • name, enter text in quotes, for example: "Employees.xlsx"
    .
      • For
    dynamic file names, use an expression to generate a name, for example:
      • a dynamically generated name, enter an expression that returnd a string; see Expressions and PhixScriptsFor example: "Employees_"+today()+".xlsx"
    , which will provide the file name
      • generates the name Employees_20220831.xlsx.
    The expression must return a string.
    • Output Directory
    , determines where the file will be placed inside
    • enter an expression to specify where PhixFlow saves the file in the export directory on the server, unless Ignore Base Directory is ticked
    . More information on the settings can be found in . This field is an expression.
    •  for details.
    • Export File as
    ,
    • : select the
    desired output
    • file type for the exported file.
      For this example we are using Excel Spreadsheet.
    • Overwrite existing file
     can be ticked if you always want
    • : optionally tick to overwrite files that have the same name
    . For example, if you only require

    • for example to have only one Employees.xlsx file on the server at any one time.
    • Header
     is ticked so the output file has column headers. Input MultiplierInput Multiplier, The input multiplier expression should evaluate
    • : optionally tick to include column headers in the output file.
  3. In Input Multiplier set:
    • Input Multiplier: enter an expression that evaluates to a list of one or more values. For each value in the list, the internal variable, _inputMultiplier, will be set to that value
    . We will . To do this set the input multiplier to
    • , so enter:
    if
    •    if(countElements(recs) > 0, countElements(recs), 0)
  4. In Send by Email set:
    • Email From
    , this should be
    • : enter the email address set in
    Email Accounts → Email Account
    • the email account Login. For example, notifications@phixflow.com
    • Subject Expression
    , this is an expression field. For
    • : enter an expression to generate the subject line of the email, for example, "RE: Employee Records "+today()
    • Attach File,
    Ticked if you want
    • tick to attach the
    records
    • exported file to the email.
    Leave

    • Alternatively, leave this unticked if you
    do not want to send the attachment with the email
    • want the email to include a link to the exported file.
    • Message Expression
    , this is an expression field
    • : enter an expression to generate the message. For example, the following incorporates the value from the Input Multiplier to create a message that tells the recipient how many records were processed:
     

    • "We have processed "+_inputMultiplier.1+" employee records today.".
    • Recipient Expressions
    • → TO Expression,
    This is
    • enter an expression
    field. It must contain
    • that contains the email addresses of the recipients
    of this information
    • . For example
    :
    • a single address like "info@phixflow.com".
  5. Save you changes.
  6. Save you

    • Here is a screenshot of the input multiplier and file exporter configurationImage Added
  7. Save your changes to the file exporter and to the analysis model.

Step 3  Run Analysis

  1. To run analysis on the table that is set to call calls the file exporter to , right-click and select 
    Insert excerpt
    _run_analysis
    _run_analysis
    nopaneltrue
     to test it works. For example, in
    In our example this table is is called Send Email.

Here is an example screenshot of this configuration:

Image Removed

Step 4  Set up the Actionflow

  1. From the application home screen click on Screens.
  2. Open the screen that from which you want to send the email from or create a new screen to send the email. See Designing ; see Screens.Add
  3. From the Serene Grey palette, drag in a Button to the screen that will be used to call the email. These are available from the palette.send the email. 
  4. Right-click on the button and select Add Actionflow. Give the actionflow a meaningful name, for example: Send Email Notification.
  5. In the actoinflow Actionflow that opens, click on Connection, and select On Click.
  6. From the toolbar, drag an Analysis Task an analysis node onto the Canvas.Provide a meaningful canvas and give it a name.
  7. From In the table section toolbar click 
    Insert excerpt
    _tableOnly
    _tableOnly
    nopaneltrue
    , from the pane that opens drag the Table we created earlier to call the file exporter into the Analysis Task → List. From the list of tables, drag the table that calls the file exporter onto the analysis node.
  8. Save your changes to the actionflow.
  9. Connect To connect the On Click input to the Analysis Task by dragging analysis node, drag a line between the two. See Wiring ActionflowsImage Removed; see Mappings and Connectors.
    Image Added
  10. Save your changes.

The button is now

set

configured to run

the Analysis Task that will result in the email being sent.Testing the Results

an actionflow, which:

  • runs an analysis on the model
  • to generate a data file
  • attach the file to an email
  • and sends the email to the recipient.

Step 5  Testing the Configuration

  1. Run analysis on the table that drives the file exporter that sends the email.
  2. Open the 
    Insert excerpt
    _console
    _console
    nopaneltrue
  3. In the Completed Tasks section, click on the Run Analysis Task you ran in the previous step.
  4. In the Messages for this completed task click on the Emails tab.
    If it is not visible you may need to click on the more menu to see the option.
  5.  In the Status column, one Check the Status column. It can take a few minutes for an email to be sent and sometimes longer if the attached file is large.
    One of the following common statuses will be set:
    • Ready, the email is produced
    • Incomplete, PhixFlow is trying to send the email.
      Test your email account is working correctly.
    • Sent, the email has been successfully sent.
  6. It can take a few minutes for an email to be sent and sometimes longer if the attached file is large. 
  7. If the status stays as Incomplete, test your Email Account setup above is working correctly.
  8. The Files tab shows any Check the Files tab for details of the files produced as part of this completed task.
    This is useful to see if the file exporter ran but the email portion has failed. 
  9. If you email has not been received do not receive the email,
    • check your email client's Junk folder
    • check the log for
    any
    • errors
    . It is also worth while checking your Junk folder in your emails
    • .
     

Sending an Email Incorporating Table Data

Following the example above we will now setup an example where an email will be sent to any employee that has a missing telephone number. To achieve this we will perform The following example shows you how to configure PhixFlow to email employee with no telephone number in their record. To identify these employees, we run a lookup that only returns the employee records without a telephone number, however you can easily amend this setup to suit your needs:

Create an Analysis Model

.

You can adapt the steps by using a lookup that provides the email addressees that you require.

  1. Create an analysis model or open one that contains the required table.
  2. From the Toolbar toolbar, drag a 
    Insert excerpt
    _file_exporter
    _file_exporter
    nopaneltrue
     onto the canvas.
  3. Connect the Table which contains the desired data to the File Exporter.Connect the Table which contains the desired data to the File Exporter, a table to the file exporter, and then connect them a second time.
  4. In the pipe properties which that open, set:
    • Name
    ,
    • : recs.
    • Type
    ,
    • : select Look-up.
    • Filter
    , Set
    • : set the filter criteria for the lookup,
    we only want
    • to return
    the records we wish to interact with.
    • only the data you need.
      In this example, the filter allows only
    the records which have a missing telephone number
    • records where Telephone is null, as illustrated
    here
    • below:
     
    • Image Modified
  5. Save your changes to the pipe.
    The setup analysis model is similar to our previous example but with the addition of a filter on the lookup pipe, as illustrated here:
  6. The setup for the
    Insert excerpt
    _file_exporter
    _file_exporter
    nopaneltrue
    is the same as the Sending an Email example above, with the following changes:
      We
      • Attach File: unticked as we do not want users to receive a file
      , make sure Attach File is unticked
      • .
      • Input Multiplier
      , The input multiplier expression should evaluate to a
      • : the expression evaluates to the list of records
      we want to interact with. We set PhixFlow to use the records
      • from the lookup pipe. In our example the lookup pipe is called mtn so we set the _inputMultiplier to: mtn
      • Send HTML
      ,
      • : tick
      this as we want
      • to send our contacts a HTML email.
      • Message Expression

      , With
      • : as Send HTML is ticked, the message box is treated as

      html which allows us to
      • a HTML field. This means you can use HTML markup

      in our message
      • . In our example we want to send a personalised message to the user with their first name

      ,
      • and a link to login to PhixFlow

      . See
      • .

        Code Block
        firstline1
        titlePhixFlow HTML Message
        linenumberstrue
        do(
          "<p>Hi " + mtn.FirstName + ",</p>"+
          "<p>Please login to PhixFlow and update your number.</p>"+
          "<a href='https://
      services.
      • phixflow.com/
      themes
      • PhixFlow/start.html?application=
      Anthony
      • MyApplication'>PhixFlow Login</a>"
        )


    • Save

      Your

      your changes.

    • Run analysis on the table set to call that calls the file exporter to test it works. For example, in In our example this table is called Send Email Requests.

      We can now

When you know the configuration works, connect the

table

button to an

button and

actionflow as

outlined

explained in the Sending an Email

example above

 above.

Learn More

Send Emails with Excel Template

See Excel Template.

More Information

For more information on the file exporter and a full list of email options see, File Exporter.

For more information on expressions and using them in expression fields see, Expressions and PhixScripts