Last active
September 19, 2019 05:10
-
-
Save campeterson/64988420e7d4f2dab2f4b920a394d3f6 to your computer and use it in GitHub Desktop.
Send email from Clojure AWS API
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;https://github.com/cognitect-labs/aws-api | |
(require '[cognitect.aws.client.api :as aws]) | |
(def ses (aws/client {:api :email})) | |
(aws/ops ses) | |
(keys (aws/ops ses)) | |
(aws/doc ses :SendEmail) | |
;; Email addresses must be verified if in sandbox mode | |
(def payload | |
{:Destination {:ToAddresses ["[email protected]"]} | |
:Message {:Subject {:Charset "UTF-8" | |
:Data "Sent from AWS SES"} | |
:Body {:Text {:Charset "UTF-8" | |
:Data "This is the body of my email"}}} | |
:Source "[email protected]"}) | |
(aws/invoke ses {:op :SendEmail :request payload}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{:deps {com.cognitect.aws/api {:mvn/version "0.8.352"} | |
com.cognitect.aws/endpoints {:mvn/version "1.1.11.607"} | |
com.cognitect.aws/email {:mvn/version "742.2.527.0"}}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment