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.

Reply via email to