Email Workflow Complete Template

@{
    #* A workflow will only work with the following version of 
    #*   kenaflow. After you tested your workflow with a new 
    #*   version of kenaflow you can change the following 
    #*   setting. 
    Version = "4.0";
    
    #* set it to $true to ENABLE the workflow. ($false DISABLES it)
    Enabled = $false; 
    
    #* Type = SHAREPOINT, EMAIL, PowerShell
    Type = "EMAIL";
    
    #* SubType 
    #*   if "SHAREPOINT" then ALL, LASTMODIFIED (alias LIST), 
    #*   QUERY, SITE, STATEMACHINE if "EMAIL" then 
    #*   EXCHANGE2007SP1, EXCHANGE2010, EXCHANGE2010SP1, 
    #*   EXCHANGE2010SP2, EXCHANGE2013, EXCHANGE2013SP1, 
    #*   EXCHANGE, EXCHANGEONLINE, POP3, IMAP if "POWERSHELL" => EMPTY
    SubType = "IMAP";
    
    #* set it to a meaningful name
    Name = "<<wfname>>"; 
    
    #* a unique (!) id (type 'System.Guid') for this workflow. 
    #*   must be unique in YOUR environment. Use 
    #*   "[guid]::newGuid().tostring('d')" to create a GUID in 
    #*   Powershell. 
    Id = "<<wfid>>"; 
    
    #* A list of one or more files that are checked during deserialization.
    #*   The workflow configuration is reserialized if such an additional
    #*   file was modified since last serialization or is missing.
    #AdditionalConfigFiles = @();

    #* option. can be used to specify the folder where the 
    #*   workflow scripts are in. the workflow directory (where 
    #*   the _wfconfig.ps1 is in) is used if empty. 
    #ScriptFolder = ""; 
    
    #* "Time between execution" => minimal time difference IN 
    #*   SECONDS between two executions of the workflow 
    TBE = 60; 
    
    #* CRON-style pattern for execution scheduling. Please 
    #*   consult our documentation to get more infos on that. 
    #*   Make sure you set TBE > 0 to activate time-based 
    #*   execution. First TBE is checked and afterwards CRON if 
    #*   set. 
    #Cron = "0 * * * *"; 
    
    #* During a time based workflow run the same workflow 
    #*   should start also on another kenaflow server (in case of 
    #*   scaling). If your really sure that you want to run 
    #*   multiple instances of the same workflow than you can set 
    #*   this to $FALSE. 
    #Locking = $true;    
    
    #* This can be used to specify one or more custom 
    #*   PowerShell libariy files that will be executed before 
    #*   workflow script execution. 
    #CustomLibrary = @(""); 
    
    #* Here you can specify a script for error handling. It's 
    #*   processed in case of exceptions within the workflow 
    #*   script. Please read 
    #*   https://doc.kenaflow.com/basics/errorhandling 
    #ErrorHandlingScript = "errorHandling.ps1"
        
    #* Can be used to mark this workflow as "in debug" for use 
    #*   with cmdlet Get-KFInDebug -WorkflowDebugState 
    #Debug = $false; 
    
    #* This file will be serialized for performance reasons. 
    #*   You can prevent serialization by setting this option.
    #NoSerializing = $false;
    
    #* This file will be serialized for performance reasons as 
    #*   long as property 'NoSerializing' is not set to $true. 
    #*   But you can specify a "maximum lifetime" here. if this 
    #*   amount of time elapsed the workflow configuration gets 
    #*   re-serialized. Possible values are TimeSpan (object or 
    #*   string) or amount of seconds (int or string) 
    #MaxLifetimeOfSerialization = "0:5" #5 minutes
    
    #* If set to $false the workflow will continue with the 
    #*   next item on workflow script errors. Default ist $true 
    #*   ("stop workflow on script errors") 
    #StopWorkflowOnScriptError = $true; 
    
    #* For Exchange (on-premises or Online)
    #EmailDomain = "example.com";
    
    #* E-Mail Account
    EmailUsername = "";
    
    #* E-Mail Password
    EmailPassword = "";
    
    #* Ignore SSL cert errors ? 
    #*   $true (default) or $false
    EmailIgnoreSSLErrors = $true;
    
    #* E-Mail address of the monitored account - e.g. 
    #*   kenaflow@example.com - to auto-discover the Exchange 
    #*   server Required if SUBTYPE is EXCHANGE* 
    #EmailExchangeAutodiscoverEmailAddress = "";
    
    #* URL of the Exchange Service
    #EmailExchangeServiceUrl = "";
    
    #* Server addess (required for SUBTYPE == POP3 or == IMAP)
    #EmailServerAddress = "imap.example.com";
    
    #* Security Settings (for IMAP and POP3) => AUTO (default), 
    #*   NONE, SSLONCONNECT, STARTTLS, STARTTLSWHENAVAILABLE 
    #EmailServerSecurity = "AUTO";
    
    #* Port of the mail server (for IMAP and POP3); -1 is 
    #*   default: guess 'port' from 'Subtype' (IMAP, POP3) and 
    #*   'EmailServerSecurity' 
    #EmailServerPort = -1;
    
<#    
#* =============================================================================================================
#*   when using E-Mail Workflow with SharePoint you need to 
#*   configure this section 

    #* what SharePoint do you use? Possible values: "sp2013" or 
    #*   "sp2016" or "sp2019" or "spo" 
    Platform = ""; 
    
    #* The following two parameters can be used to specify credentials
    #*   however it is possible to store credentials in a 
    #*   protected fashion using the parameters --setusername 
    #*   and --setpassword on kenaflow.exe while running the 
    #*   program inside a workflow folder that contains 
    #*   _wfconfig.ps1. this will create a file 
    #*   _wfconfig-cred.ps1 that contains encrypted credentials. 
    #*   the credentials can only decrypted on the same machine. 
    #*   on other machines the file is worthless. 
    #spUser = "";
    #spPwd = '';

    #* only if platform is 'spo' = SharePoint Online
    #spoAppId = ""; 
    #* only if platform is 'spo' = SharePoint Online
    #spoAppSecret = ''; 

    
    #* Full URL to the SharePoint web where the workflow list 
    #*   is in 
    Web = ""; 
    
    #* A list of alternate URLS, e.g. if a web application has 
    #*   Alternate Access Mappings. Remove Events could be 
    #*   received with such an alternate URL 
    #AlternateWebUrls = @();

    #* a list for global config values
    ConfigList = "WFconfig"; 
    
    #* a list that can be used to store data
    DataList = "WFData"; 
    
    #* a list that can be used to record log information
    HistoryList = "WFHistory"; 
    
    #* Workflow errors will be stored in this SharePoint list
    ErrorList = "WFErrors";

    #* Force workflow script to run again in case of "version 
    #*   conflict" (parallel item modifications in SharePoint). 
    #*   Default: $false 
    #RetryOnVersionConflict = $false; 

    #UserProfileCacheLifetime = 60; #In seconds. If not specified the global setting from kenaflow.conf is used
 

#* ============================================================================================================= 
#*      
#>
    
    #* Can be uses to define default config entries that will 
    #*   be deployed to the config list if the workflow config 
    #*   list is created by kenaflow (kenaflow.exe) 
    ConfigListDefaults = @{
        "kenaflow" = "cool"
    }; 
    
    #* List of mail addresses that will receive mails in case 
    #*   of workflow internal errors. 
    AlertAddresses = @(); 
    #* can be used to overwrite the global settings.
    #AlertFloodProtection = 3600; 
    #* Address of the sender of mails that the workflow sends. 
    #*   If empty it will be taken from the kenaflow global 
    #*   config 
    #MailFrom = ""; 
    
    #* Address to which uses can reply to. If empty it will be 
    #*   taken from the kenaflow global config 
    #MailReply = ""; 
    
    #* This script contains all to workflow actions
    #Script = "script.ps1";
            
    #* After this amount of time elasped the workflow execution 
    #*   will be stopped; -1 = use default 
    #MaxExecutionTime = -1;     

    
    
    #* +++++++++++++++++++
    #*   runtime settings
        
    #* (only) kenaflow Cmdlets will throw Exceptions on failure 
    #*   ($true) or hide them ($false). In the last case the 
    #*   exception can be queried with Get-KFLastResult. Default 
    #*   is $true 
    #ThrowErrorsPreference = $true; 
    #* This is the default for the common PowerShell variable 
    #*   $ErrorActionPreference that controls the default 
    #*   PowerShell error handling. Default is "Stop". This can 
    #*   be overwritten by Invoke-Kenaflow -ErrorActionPreference 
    #*   <value> or in script using $ErrorActionPreference = 
    #*   <value> 
    #ErrorActionPreference = 'Stop';
    
    #* +++++++++++++++++++
    #*   debug settings 
        
    #* if not specified here the default setting from kenaflow 
    #*   will be used. 
    #writeMailsToDiskDuringDebug = $true;
    
    #* if not specified here the default setting from kenaflow 
    #*   will be used. 
    #alwaysWriteMailsToDiskInsteadSending = $false; 
    
    #* can be used to redirect all mails to the specified 
    #*   account(s) 
    #redirectAllMails = @(); 
    
    #* this parameter can be used to force client processes 
    #*   (--exec) to send PowerShell output serialzied to the 
    #*   main proces (--run) Default: $false
    #SendOutputToMainProcess = $false;
}

if(!$kenaflow){import-module "<<directory>>\kenaflow.runtime.dll";Test-KFConfig;exit}

Discussion

Discussion