Shard Detail

carbon_aws_ses_adapter v1.2.0

No Description

Install & Use

Add the following code to your project's shard.yml under:

dependencies to use in production
- OR -
development_dependencies to use in development


carbon_aws_ses_adapter:
  github: keizo3/carbon_aws_ses_adapter

Readme

Carbon AWS SES Adapter

Build Status

This is luckyframework/carbon's adapter for AWS SES (Simple Email Service)

https://github.com/luckyframework/carbon

Installation

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"

Usage

Configure AWS SES Simple Email Service

  1. Go to the Amazon Web Services developer console.
  2. Ensure that AWS SES is correctly set up according to the documentation.
  3. Create an AWS IAM user who can send emails. The user must have at least the following permissions:
    • ses:SendEmail
    • ses:SendRawEmail
  4. Copy the AWS Access Key and AWS Secret Access key for the IAM user you've created.
  5. Set up the adapter in Lucky via the config/email.cr file.

Configure the mailer class

# 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

Development

  • shards install
  • Make changes
  • 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

Contributing

  1. Fork it ( https://github.com/keizo3/carbon_aws_ses_adapter )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Make your changes
  4. Run ./bin/test to run the specs, build shards, and check formatting
  5. Commit your changes (git commit -am 'Add some feature')
  6. Push to the branch (git push origin my-new-feature)
  7. Create a new Pull Request

Contributors

  • keizo3 - creator, maintainer