Add the following code to your project's shard.yml under:
dependencies
to use in production
- OR -
development_dependencies
to use in development
This is luckyframework/carbon's adapter for AWS SES (Simple Email Service)
https://github.com/luckyframework/carbon
Add this to your application's shard.yml
:
dependencies:
carbon_aws_ses_adapter:
github: keizo3/carbon_aws_ses_adapter
Add this to your application's shards.cr
:
require "carbon_aws_ses_adapter"
ses:SendEmail
ses:SendRawEmail
config/email.cr
file.# config/email.cr
BaseEmail.configure do
settings.adapter = Carbon::AwsSesAdapter.new(
key: ENV["AWS_SES_ACCESS_KEY"],
secret: ENV["AWS_SES_SECRET_KEY_KEY"],
region: ENV["AWS_SES_REGION"]
)
end
shards install
crystal spec
(will skip sending test emails to AWS SES)crystal spec -D send_real_email
(will send real emails, and requires the below .env
file content)# In .env
# If you want to run tests that actually test emails against the AWS SES
AWS_SES_ACCESS_KEY=get_from_aws_ses_key
AWS_SES_SECRET_KEY=get_from_aws_ses_secret
AWS_SES_REGION=get_from_aws_ses_region
AWS_SES_FROM_ADDRESS=verified_address
AWS_SES_TO_ADDRESS=recipient_address
./bin/test
to run the specs, build shards, and check formatting