Search in sources :

Example 1 with SendRawEmailResult

use of com.amazonaws.services.simpleemail.model.SendRawEmailResult in project camel by apache.

the class AmazonSESClientMock method sendRawEmail.

@Override
public SendRawEmailResult sendRawEmail(SendRawEmailRequest sendRawEmailRequest) throws AmazonServiceException, AmazonClientException {
    this.sendRawEmailRequest = sendRawEmailRequest;
    SendRawEmailResult result = new SendRawEmailResult();
    result.setMessageId("1");
    return result;
}
Also used : SendRawEmailResult(com.amazonaws.services.simpleemail.model.SendRawEmailResult)

Example 2 with SendRawEmailResult

use of com.amazonaws.services.simpleemail.model.SendRawEmailResult in project camel by apache.

the class SesProducer method process.

public void process(Exchange exchange) throws Exception {
    if (!(exchange.getIn().getBody() instanceof javax.mail.Message)) {
        SendEmailRequest request = createMailRequest(exchange);
        log.trace("Sending request [{}] from exchange [{}]...", request, exchange);
        SendEmailResult result = getEndpoint().getSESClient().sendEmail(request);
        log.trace("Received result [{}]", result);
        Message message = getMessageForResponse(exchange);
        message.setHeader(SesConstants.MESSAGE_ID, result.getMessageId());
    } else {
        SendRawEmailRequest request = createRawMailRequest(exchange);
        log.trace("Sending request [{}] from exchange [{}]...", request, exchange);
        SendRawEmailResult result = getEndpoint().getSESClient().sendRawEmail(request);
        log.trace("Received result [{}]", result);
        Message message = getMessageForResponse(exchange);
        message.setHeader(SesConstants.MESSAGE_ID, result.getMessageId());
    }
}
Also used : Message(org.apache.camel.Message) SendRawEmailResult(com.amazonaws.services.simpleemail.model.SendRawEmailResult) SendRawEmailRequest(com.amazonaws.services.simpleemail.model.SendRawEmailRequest) SendEmailResult(com.amazonaws.services.simpleemail.model.SendEmailResult) SendEmailRequest(com.amazonaws.services.simpleemail.model.SendEmailRequest)

Aggregations

SendRawEmailResult (com.amazonaws.services.simpleemail.model.SendRawEmailResult)2 SendEmailRequest (com.amazonaws.services.simpleemail.model.SendEmailRequest)1 SendEmailResult (com.amazonaws.services.simpleemail.model.SendEmailResult)1 SendRawEmailRequest (com.amazonaws.services.simpleemail.model.SendRawEmailRequest)1 Message (org.apache.camel.Message)1