https://github.com/wout/carbon_mailjet_adapter
A Mailjet adapter for the carbon email library
https://github.com/wout/carbon_mailjet_adapter
carbon email lucky-framework mailjet transactional-emails
Last synced: 20 days ago
JSON representation
A Mailjet adapter for the carbon email library
- Host: GitHub
- URL: https://github.com/wout/carbon_mailjet_adapter
- Owner: wout
- License: mit
- Created: 2024-04-25T11:38:05.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-04-25T11:58:09.000Z (about 1 year ago)
- Last Synced: 2025-02-13T08:14:41.937Z (2 months ago)
- Topics: carbon, email, lucky-framework, mailjet, transactional-emails
- Language: Crystal
- Homepage:
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# carbon_mailjet_adapter
Integration for Lucky's [Carbon](https://github.com/luckyframework/carbon) email library and [mailjet.cr](https://github.com/wout/mailjet.cr) to send emails via [Mailjet](https://www.mailjet.com/).
## Installation
1. Add the dependency to your `shard.yml`:
```yaml
dependencies:
carbon_mailjet_adapter:
github: wout/carbon_mailjet_adapter
```2. Run `shards install`
## Usage
Include the shard:
```crystal
require "carbon_mailjet_adapter"
```Configure [mailjet.cr](https://github.com/wout/mailjet.cr):
```crystal
Mailjet.configure do |settings|
settings.api_key = "your-api-key"
settings.secret_key = "your-secret-key"
settings.default_from = "[email protected]"
end
```And configure the adapter in your Lucky app:
```crystal
# config/email.cr
require "carbon_mailjet_adapter"BaseEmail.configure do |settings|
if LuckyEnv.production? || LuckyEnv.staging?
settings.adapter = Carbon::MailjetAdapter.new
elsif ...
...
end
end
```**Important:** For simplicity and predictability, this adapter will always send using Mailjet's v3.1 sending API, regardless of the Mailjet configuration in your project.
## Contributing
1. Fork it ()
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'feat: add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request## Contributors
- [Wout](https://github.com/wout) - creator and maintainer