camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akoufoudakis <akoufoudaki...@gmail.com>
Subject Re: how to get subject and body for mail from a properties file
Date Thu, 14 May 2015 07:54:59 GMT
Hello, Gordon!

I would do it like this.


<camelContext>
<propertyPlaceholder id="emailProps" location="classpath:xxx"/>
<route id="ActionProcessor:direct:email">
            <from uri="direct:email"/>
            <setHeader headerName="subject">
               
<constant>{{some.processor.consumer.camel.email.subject}}</constant>
            </setHeader>
            <setHeader headerName="contentType">
                <constant>text/plain;charset=UTF-8</constant>
            </setHeader>
            <setBody>
               
<constant>{{some.processor.consumer.camel.email.body}}</constant>
            </setBody>
            <to ref="uri"/>
        </route>
</camelContext>

If you want to keep your property file visible in your whole spring context,
then I would do a trick like:

 <context:property-placeholder ignore-resource-not-found="true"
location="classpath:xxx" id="props"/>
   <propertyPlaceholder id="myProps" location="ref:props"/>
   ......
<camelContext>


</camelContext>


For more information you can always go to
http://camel.apache.org/properties.html




--
View this message in context: http://camel.465427.n5.nabble.com/how-to-get-subject-and-body-for-mail-from-a-properties-file-tp5767080p5767095.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message