Last active
August 18, 2021 16:20
-
-
Save tombasche/543abc0b1f95faef36b4a34c6fd0d3db to your computer and use it in GitHub Desktop.
SES Email client config + Sprint + Kotlin
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
package com.myapplication.email | |
import org.springframework.beans.factory.annotation.Value | |
import org.springframework.context.annotation.Bean | |
import org.springframework.context.annotation.Configuration | |
import software.amazon.awssdk.regions.Region | |
import software.amazon.awssdk.services.ses.SesClient | |
@Configuration | |
class EmailClientConfiguration { | |
@Value("\${email.aws-region}") | |
lateinit var awsRegion: String | |
@Bean | |
fun awsEmailService(): SesClient { | |
return SesClient | |
.builder() | |
.region(Region.of(awsRegion)) | |
.build() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment