Summary

This article covers the email command. 


Description

This command sends an email to the specified target with the provided subject and body. Email triggers are sent based on whatever target is specified (question or form).

Attributes

  • none

Parameters

  • to
  • from
  • cc
  • subject
  • body


For the “to” and “cc” parameters, wrap the email addresses in a list command to specify more than one address. An example of how to do this is found below.


When using the concat in an email trigger (within the body tag), you can use “\n” to create new lines in the email which can provide some basic formatting within the body of the email. NOTE: Some email programs (e.g. Outlook, etc.) will attempt to remove these new lines. To prevent this from happening, add 2 spaces at the beginning of the string command after the \n: 


Note: When setting up your ‘to’ and ‘cc’ lists, it is advisable to use the if command to check to see what server you are on before determining who will get the emails. The example below shows an example of how to use it. It uses the environment command to determine the origin location. Currently the only environments are ‘Staging’ and ‘Production’ for normal trial design. ‘Staging’ refers to the Design, Test, and Approve servers. ‘Production’ refers to the ‘Secure’ servers. If you forget or fail to do this, all recipients will get the emails regardless of whether they are from your own testing, QA testing, or actual production events.


Example

<script scriptId="emailTrigger">
    <body>
        <s:if>
            <s:lte>
                <s:numberPath path=".rate:value"/>
                <s:number value="40"/>
            </s:lte>
            
            <s:email>
                <s:to>
                    <s:if>
                        <s:eq>
                            <s:environment/>
                            <s:string value="Staging"/>
                        </s:eq>
                        <s:list>
                            <s:string value="emailtriggers@fountayn.com"/>
                            <s:string value="test1@clientAddress.net"/>
                        </s:list>
                        <s:list>
                            <s:string value="emailtriggers@fountayn.com"/>
                            <s:string value="test1@clientAddress.net"/>
                            <s:string value="test2@clientAddress.net"/>
                            <s:string value="test3@clientAddress.net"/>
                        </s:list>
                    </s:if>
                </s:to>
                <s:from>
                    <s:string value="no-reply@fountayn.com"/>
                </s:from>
                <s:subject>
                    <s:string value="Heart Rate <= 40 bpm"/>
                    </s:subject>
                    <s:body>
                        <s:concat>
                            <s:string value="Patient #: "/>
                            <s:stringPath path="/registration.patID:value"/>
                            <s:string value=" - Heart Rate <= 40 bpm"/>
                            </s:concat>
                        </s:body>
                    </s:email>
                    
                </s:if>
            </body>
            <target typeId="rate" action="update" when="after" shouldReconcile='false'/> 
</script>

Need more help?

Please visit the Fountayn Contact Information page.