Member since
12-27-2017
1
Post
0
Kudos Received
0
Solutions
12-27-2017
02:36 PM
My application work with some dynamic generated files & once my workflow is complete, I need to send the details of files in the success mail in a table format. After going through oozie docs I figured out that we can use <content_type>text/html</content_type> to do the same. My code is working fine if I use only <content_type> tag in oozie email action (mail body is delivered in table format). But I need to use <attachment> tag as well in my email action. While doing the same, the <content_type> tag isn't working as expected & I'm receiving mail in text/plain format. Given below is my code snippet <action name="success">
<email xmlns="uri:oozie:email-action:0.2">
<to>${recipients}</to>
<subject>${from_env} Success: Workflow ${wf:name()} completed successfully</subject>
<body>
<![CDATA[
<table>
<tr><td> WORKFLOW NAME </td> <td> : ${wf:name()} </td></tr>
<tr><td> WORKFLOW ID </td> <td> : ${wf:id()} </td></tr>
<tr><td> ACO NAME </td> <td> : ${acoName} </td></tr>
<tr><td> ACO_ID </td> <td> : ${acoId} </td></tr>
<tr><td> CUSTOMER_ID </td> <td> : ${customerID} </td></tr>
<tr><td> SUPPLIER_ID </td> <td> : ${supplierId} </td></tr>
<tr><td> APP PATH </td> <td> : ${wf:appPath()} </td></tr>
</table>
<table>
<tr>
<td>File1.txt</td>
<td>File_absent</td>
</tr>
<tr>
<td>File2.txt</td>
<td>File_present</td>
</tr>
</table>
]]>
</body>
<content_type>text/html</content_type>
<attachment>${filePath}</attachment>
</email> Note: 1- If I'm not using the <attachment> tag email-action is working fine & i'm receiving mail in table format 2- While using <content_type> & <attachment> tag together it is not working as expected Any help appreciated!! Thanks!
... View more
Labels:
- Labels:
-
Apache Oozie