Hi Manoj, OOZIE-2160 added the ability to attach a file to an email from the email action. It's unfortunately not in any current CDH release. It looks like we'll be including it in CDH 5.5.0.
I'm guessing you're looking at the docs here? http://oozie.apache.org/docs/4.2.0/DG_EmailActionExtension.html I'd recommend using Cloudera's copy here http://archive.cloudera.com/cdh5/cdh/5/oozie/DG_EmailActionExtension.html if you're using CDH to ensure that the docs you're using matches the codebase you're using. As you can see, it doesn't mention <attachement> because it's not there yet. - Robert On Sat, Sep 26, 2015 at 4:46 AM, Manoj Babu <[email protected]> wrote: > Hi, > > I am facing a strange behavior in Oozie email action with attachment. > > Oozie version: > Oozie server build version: 4.0.0-cdh5.3.3 > > Action: > <action name="bragreport"> > <email xmlns="uri:oozie:email-action:0.2"> > <to>${success_emails}</to> > <subject>test attachment</subject> > <body>Hi - email to test attachment</body> > *<content_type>image/jpeg</content_type>* > * <attachment>/user/manoj/PieChart.jpeg</attachment>* > </email> > <ok to="end" /> > <error to="kill" /> > </action> > > -sh-4.1$ oozie validate workflow.xml > Error: Invalid app definition, org.xml.sax.SAXParseException; lineNumber: > 51; columnNumber: 13; cvc-complex-type.2.4.d: Invalid content was found > starting with element 'attachment'. No child element is expected at this > point. > > After removing attachment element the error dissappers but in > email-action:0.2.xsd content_type and attachment elementes are supported > but here it behaves strange. > > <action name="bragreport"> > <email xmlns="uri:oozie:email-action:0.2"> > <to>${success_emails}</to> > <subject>test attachment</subject> > <body>Hi - email to test attachment</body> > * <content_type>image/jpeg</content_type>* > </email> > <ok to="end" /> > <error to="kill" /> > </action> > > -sh-4.1$ oozie validate workflow.xml > Valid workflow-app > > > Cheers! > Manoj. >
