emailstaffnotification

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revisionBoth sides next revision
emailstaffnotification [2019/07/31 15:57] – More explanation and HTTPServerPort in job Michael Scottemailstaffnotification [2019/08/01 12:13] – loadform Michael Scott
Line 7: Line 7:
   * Email Address - can be one or more recipient addresses, separated by commas or semicolons   * Email Address - can be one or more recipient addresses, separated by commas or semicolons
  
-  * Message Text - the text of the email - if invoked by RequestLinkedEmailStaffNotification (see below). May contain tokens such as <code>{loadform}/person/{personid}/cv</code> which will convert to hyperlinks to load a specified form and view in IQX+  * Message Text - the text of the email - if invoked by RequestLinkedEmailStaffNotification (see below). May contain tokens such as <code>{loadform}person/{personid}/cv{/loadform}</code> which will convert to hyperlinks to load a specified form and view in IQX
   * Supported tokens are:   * Supported tokens are:
     * {personid}     * {personid}
     * {companyid}     * {companyid}
     * {vacancyid}     * {vacancyid}
-    * {loadform}+    * {loadform} to start a hyperlink, matched by {/loadform} to end it
  
   * Division and Department can be used to narrow down the recipients for a particular notification. If they are left blank this recipient will receive all notifications for the topic   * Division and Department can be used to narrow down the recipients for a particular notification. If they are left blank this recipient will receive all notifications for the topic
Line 18: Line 18:
 A Scheduled Job, EmailStaffNotifier.xml or equivalent, must be running to do the actual sending. ++++Sample Job|<sxh xml><?xml version="1.0"?> A Scheduled Job, EmailStaffNotifier.xml or equivalent, must be running to do the actual sending. ++++Sample Job|<sxh xml><?xml version="1.0"?>
 <Job title="Dispatch Email Notifications" autoclose="Yes"> <Job title="Dispatch Email Notifications" autoclose="Yes">
- <SQLQuery> +    <SQLQuery> 
- <SQLSelect> +        <SQLSelect> 
- <![CDATA[ +            <![CDATA[ 
- select id, topic, body, hyperlink, departmentid, divisionid  +                select id, topic, body, hyperlink, departmentid, divisionid  
- from EmailStaffNotification +                from EmailStaffNotification 
- where Dispatched is null and Requested > current date - 3 +                where Dispatched is null and Requested > current date - 3 
- ]]> +            ]]> 
- </SQLSelect> +        </SQLSelect> 
- <ForEachRow> +        <ForEachRow> 
- <SetVariable name="recipients" sql="select list(emailaddress,';') from EmailStaffNotificationAddress where topic=:topic and (departmentid=:departmentid or departmentid is null) and (divisionid=:divisionid or divisionid is null)"/> +            <SetVariable name="recipients" sql="select list(emailaddress,';') from EmailStaffNotificationAddress where topic=:topic and (departmentid=:departmentid or departmentid is null) and (divisionid=:divisionid or divisionid is null)"/> 
- <If x1="{recipients}" x2="" comparison="!="> +            <If x1="{recipients}" x2="" comparison="!="> 
- <SetVariable name="emailbody"> +                <SetVariable name="emailbody"> 
- <WriteLn>{body}</WriteLn> +                    <WriteLn>{body}</WriteLn> 
- <If x1="{hyperlink}" x2="" comparison="!="> +                    <If x1="{hyperlink}" x2="" comparison="!="> 
- <WriteLn/> +                        <WriteLn/> 
- <WriteLn>http://localhost:{HTTPServerPort}/iqx/loadform/{hyperlink}</WriteLn> +                        <WriteLn><![CDATA[<br/><a href="iqxw://iqx/loadform/{hyperlink}">Open in IQX</a><br/>]]></WriteLn> 
- <WriteLn>Note: the above link will only work if IQX is running on the current device and configured to respond</WriteLn> +                        <WriteLn>Note: the above link will only work if IQX is running on the current device and configured to respond</WriteLn> 
- </If> +                    </If> 
- </SetVariable> +                </SetVariable> 
- <SendEmail subject="IQX Notification" smtpsettings="EMAILSTAFFNOTIFY"> +                <SendEmail subject="IQX Notification" smtpsettings="EMAILSTAFFNOTIFY" html="YES"> 
- <EmailRecipients>{recipients}</EmailRecipients> +                    <EmailRecipients>{recipients}</EmailRecipients> 
- <EmailBody>{emailbody}</EmailBody> +                    <EmailBody>{emailbody}</EmailBody> 
- </SendEmail> +                </SendEmail> 
- </If> +            </If> 
- <SQLExec> +            <SQLExec> 
- <![CDATA[update EmailStaffNotification set Dispatched=current timestamp, Recipients=:recipients where id=:id]]> +                <![CDATA[update EmailStaffNotification set Dispatched=current timestamp, Recipients=:recipients where id=:id]]> 
- </SQLExec> +            </SQLExec> 
- </ForEachRow> +        </ForEachRow> 
- </SQLQuery>+    </SQLQuery>
 </Job> </Job>
 </sxh>++++ </sxh>++++
  • emailstaffnotification.txt
  • Last modified: 2019/08/01 17:33
  • by Michael Scott