Support Questions
Find answers, ask questions, and share your expertise

Who agreed with this topic

Oozie email action with content_type (text/html) and attachment tag is sending mail in normal text/plain format

New Contributor

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">
      <subject>${from_env} Success: Workflow ${wf:name()} completed successfully</subject>
            <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>


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!

Who agreed with this topic