Skip to content

Instantly share code, notes, and snippets.

@tombasche
Last active August 18, 2021 16:20
Show Gist options
  • Save tombasche/543abc0b1f95faef36b4a34c6fd0d3db to your computer and use it in GitHub Desktop.
Save tombasche/543abc0b1f95faef36b4a34c6fd0d3db to your computer and use it in GitHub Desktop.
SES Email client config + Sprint + Kotlin
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