I would like to read some email details from the DB, and here’s what my connector looks like:
<jdbc:connector name="dbConnector" dataSource-ref="dataSource">
<jdbc:query key="sqlQuery"
value="SELECT from, to, subject, body FROM email WHERE status='PENDING'" />
<jdbc:query key="sqlQuery.ack"
value="UPDATE email SET status='IN PROGRESS' WHERE id=#[map-payload:id]" />
</jdbc:connector>
I would then like to use those details to send a bunch of mails. I expect that the inbound-endpoint will be the JDBC Connector and the outbound-endpoint will be SMTP Connector, but I don’t know how to store and use data I read from that table. Is there a way to do this without resorting to Java code?
Using transformers should be enough to achieve your goal: the inbound JDBC endpoint will give you a Map payload. From this payload you will extract the properties required by the outbound SMTP endpoint and the body of the message: