Advanced Customization > Windchill ESI Customization > ERP Connector Customization > ERP Connector Customization Examples > Distribution Target Examples > Sending e-mail to a group alias after uploading the response data to an FTP server
Sending e-mail to a group alias after uploading the response data to an FTP server
This requires performing the steps outlined in the following sections.
Create a custom I*E task for sending e-mail after uploadingthe response data
Create a copy of the file
<Windchill>/tasks/com/ptc/windchill/esi/export/ExportToFTP.xml in
<Windchill>/tasks/com/ptc/windchill/esi/export/ExportToFTPEx.xml.
Open the file in your preferred editor and make changes to it as outlined below:
Open the file in your preferred editor and make changes to it as outlined below:
Add the following code snippet before invoking the Send-Mail webject:
<%
WTProperties properties = WTProperties.getLocalProperties(); setParam("MAIL_SERVER", properties.getProperty("wt.mail.mailhost"));
%>
Add the following after the Write-To-Ftp webject invocation:
<ie:webject name="Send-Mail" type="MSG">
<ie:param name="MAIL_SERVER" data="${@FORM[]MAIL_SERVER[0]}" />
<ie:param name="TO" data="erpadmin@myorg.com" />
<ie:param name="FROM" data="${@FORM[]MAIL_FROM_ADDRESS[0]}"/>
<ie:param name="SUBJECT" data="Upload is successful for transaction
${@FORM[]TransactionID[0]}" />
<ie:param name="CONTENT" data="The ESI response data in XML form for transaction ${@FORM[]TransactionID[0]} was uploaded to the FTP server successfully."/>
<ie:param name="GROUP_OUT" data="${@FORM[]group_out[0]}" default="output"
/>
</ie:webject>
Define an FTP type distribution target to send e-mail to
Use the Manage Distribution UI to create a distribution target
Select FTP as the type of target.
Specify values for the Number, Name, Description and other required attributes of the target.
Change the value of the taskURI attribute to com/ptc/windchill/esi/export/ExportToFTPEx.xml
Click Finish to save the distribution target.
Associate the above created distribution target to a business object (such as a part) and release it. This will result in an e-mail being sent to the specified address (erpadmin@myorg.com) soon after the response data is uploaded to the FTP server
Was this helpful?