Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AWS SES Sink Kamelet #669

Merged
merged 6 commits into from
Jan 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/modules/ROOT/nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* xref:aws-s3-source.adoc[]
* xref:aws-s3-streaming-upload-sink.adoc[]
* xref:aws-secrets-manager-sink.adoc[]
* xref:aws-ses-sink.adoc[]
* xref:aws-sns-fifo-sink.adoc[]
* xref:aws-sns-sink.adoc[]
* xref:aws-sqs-batch-sink.adoc[]
Expand Down
132 changes: 132 additions & 0 deletions kamelets/aws-ses-sink.kamelet.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
# ---------------------------------------------------------------------------
# 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: "main-SNAPSHOT"
camel.apache.org/kamelet.icon: "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLT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OCBMMjU2LDIzNC41OTYgTDEyOC4xODcsMjk4LjU1MiBMMTI4LjE3LDIwLjY4MyBMMjA4LjgsMTY2Ljk3NCBMMjU1Ljk3NSw3MS44NjgiIGZpbGw9IiNEOUE3NDEiPjwvcGF0aD4KCTwvZz4KPC9zdmc+"
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.

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
- accessKey
- secretKey
- 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
dependencies:
- "camel:aws2-ses"
- "camel:kamelet"
flow:
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}}"
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
# ---------------------------------------------------------------------------
# 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: "main-SNAPSHOT"
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.

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
- accessKey
- secretKey
- 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
dependencies:
- "camel:aws2-ses"
- "camel:kamelet"
flow:
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}}"