blob: 11076fc340d53cdf79594aabacdfb4db66a0bd59 [file] [log] [blame]
# ---------------------------------------------------------------------------
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ---------------------------------------------------------------------------
apiVersion: camel.apache.org/v1alpha1
kind: Kamelet
metadata:
name: aws-ses-sink
annotations:
camel.apache.org/kamelet.support.level: "Preview"
camel.apache.org/catalog.version: "0.8.1"
camel.apache.org/kamelet.icon: "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+Cjxzdmcgd2lkdGg9IjI1NnB4IiBoZWlnaHQ9IjI5OXB4IiB2aWV3Qm94PSIwIDAgMjU2IDI5OSIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiBwcmVzZXJ2ZUFzcGVjdFJhdGlvPSJ4TWlkWU1pZCI+Cgk8Zz4KCQk8cGF0aCBkPSJNNjAuNTU2LDQ3LjYwMiBMMCwxNDQuMDEgTDYwLjU1NiwyNDAuNDM0IEw2MS42MTIsMjM5LjY4MSBMNjAuODM3LDQ3LjggTDYwLjU1Niw0Ny42MDIiIGZpbGw9IiM4NzY5MjkiPjwvcGF0aD4KCQk8cGF0aCBkPSJNMTI4LjE4NywyMjMuMTA1IEw2MC41NTYsMjQwLjQzNCBMNjAuNTU2LDQ3LjYwMiBMMTI4LjE4Nyw2NC45MjcgTDEyOC4xODcsMjIzLjEwNSIgZmlsbD0iI0Q5QTc0MSI+PC9wYXRoPgoJCTxwYXRoIGQ9Ik0yNTUuOTc5LDcxLjg2OCBMMjIzLjM3OSw3Ny4yNTkgTDE0OC41MzgsMCBMMTExLjMzMSwxNi4yOTIgTDExNi4yMzksMjUuNDQ1IEw4OS45MDYsMzUuOTcxIEw4OS45MDYsMjc5LjM5OSBMMTI4LjE4NiwyOTguNTUyIEwxMjguODIzLDI5OC4wNTMgTDEyOC4yMzQsNDcuODE4IEwyMDkuMzc2LDE3MC43ODYgTDI1NS45NzksNzEuODY4IiBmaWxsPSIjODc2OTI5Ij48L3BhdGg+CgkJPHBhdGggZD0iTTE0OC41MzgsMCBMMjQ4LjIxNyw0OS44MzcgTDIwOC44LDEyMS4zNTcgTDE0OC41MzgsMCIgZmlsbD0iI0Q5QTc0MSI+PC9wYXRoPgoJCTxwYXRoIGQ9Ik0yNTUuOTc1LDcxLjg2OCBMMjU2LDIzNC41OTYgTDEyOC4xODcsMjk4LjU1MiBMMTI4LjE3LDIwLjY4MyBMMjA4LjgsMTY2Ljk3NCBMMjU1Ljk3NSw3MS44NjgiIGZpbGw9IiNEOUE3NDEiPjwvcGF0aD4KCTwvZz4KPC9zdmc+"
camel.apache.org/provider: "Apache Software Foundation"
camel.apache.org/kamelet.group: "AWS SES"
labels:
camel.apache.org/kamelet.type: "sink"
spec:
definition:
title: "AWS SES Sink"
description: |-
Send Email through AWS SES Service.
Access Key/Secret Key are the basic method for authenticating to the AWS SES Service. These parameters are optional, because the Kamelet provide also the 'useDefaultCredentialsProvider'.
When using a default Credentials Provider the SES client will load the credentials through this provider and won't use the static credential. This is reason for not having the access key and secret key as mandatory parameter for this Kamelet.
The Kamelet expects the following headers to be set:
- `subject` / `ce-subject`: The email subject
If the header won't be set the exchange ID will be used as email subject.
- `to` / `ce-to`: a comma separated list of email addresses
- `reply-to-addresses` / `ce-reply-to-addresses`: a comma separated list of reply-to email addresses
required:
- from
- region
type: object
properties:
from:
title: From
description: From address
type: string
example: user@example.com
accessKey:
title: Access Key
description: The access key obtained from AWS.
type: string
format: password
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:password
- urn:camel:group:credentials
secretKey:
title: Secret Key
description: The secret key obtained from AWS.
type: string
format: password
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:password
- urn:camel:group:credentials
region:
title: AWS Region
description: The AWS region to connect to.
type: string
example: eu-west-1
useDefaultCredentialsProvider:
title: Default Credentials Provider
description: Set whether the SES client should expect to load credentials through a default credentials provider or to expect static credentials to be passed in.
type: boolean
x-descriptors:
- 'urn:alm:descriptor:com.tectonic.ui:checkbox'
default: false
dependencies:
- "camel:core"
- "camel:aws2-ses"
- "camel:kamelet"
template:
from:
uri: "kamelet:source"
steps:
- choice:
when:
- simple: "${header[subject]}"
steps:
- set-header:
name: CamelAwsSesSubject
simple: "${header[subject]}"
- simple: "${header[ce-subject]}"
steps:
- set-header:
name: CamelAwsSesSubject
simple: "${header[ce-subject]}"
otherwise:
steps:
- set-header:
name: CamelAwsSesSubject
simple: "${exchangeId}"
- choice:
when:
- simple: "${header[to]}"
steps:
- set-header:
name: CamelAwsSesTo
simple: "${header[to]}"
- simple: "${header[ce-to]}"
steps:
- set-header:
name: CamelAwsSesTo
simple: "${header[ce-to]}"
- choice:
when:
- simple: "${header[reply-to-addresses]}"
steps:
- set-header:
name: CamelAwsSesReplyToAddresses
simple: "${header[reply-to-addresses]}"
- simple: "${header[ce-reply-to-addresses]}"
steps:
- set-header:
name: CamelAwsSesReplyToAddresses
simple: "${header[ce-reply-to-addresses]}"
- to:
uri: "aws2-ses://{{from}}"
parameters:
secretKey: "{{?secretKey}}"
accessKey: "{{?accessKey}}"
region: "{{region}}"
useDefaultCredentialsProvider: "{{useDefaultCredentialsProvider}}"