Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/martenframework/marten-sendgrid-emailing
A Sendgrid emailing backend for the Marten web framework.
https://github.com/martenframework/marten-sendgrid-emailing
crystal email emailing framework marten sendgrid web
Last synced: 19 days ago
JSON representation
A Sendgrid emailing backend for the Marten web framework.
- Host: GitHub
- URL: https://github.com/martenframework/marten-sendgrid-emailing
- Owner: martenframework
- License: mit
- Created: 2022-12-08T02:51:36.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-07-11T21:29:25.000Z (6 months ago)
- Last Synced: 2024-07-12T00:14:19.551Z (6 months ago)
- Topics: crystal, email, emailing, framework, marten, sendgrid, web
- Language: Crystal
- Homepage:
- Size: 34.2 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Marten Sendgrid Emailing
[![CI](https://github.com/martenframework/marten-sendgrid-emailing/workflows/Specs/badge.svg)](https://github.com/martenframework/marten-sendgrid-emailing/actions)
[![CI](https://github.com/martenframework/marten-sendgrid-emailing/workflows/QA/badge.svg)](https://github.com/martenframework/marten-sendgrid-emailing/actions)**Marten Sendgrid Emailing** provides a [Sendgrid](https://sendgrid.com) backend that can be used with Marten web framework's [emailing system](https://martenframework.com/docs/emailing).
## Installation
Simply add the following entry to your project's `shard.yml`:
```yaml
dependencies:
marten_sendgrid_emailing:
github: martenframework/marten-sendgrid-emailing
```And run `shards install` afterward.
## Configuration
First, add the following requirement to your project's `src/project.cr` file:
```crystal
require "marten_sendgrid_emailing"
```Then you can configure your project to use the Sendgrid backend by setting the corresponding configuration option as follows:
```crystal
Marten.configure do |config|
config.emailing.backend = MartenSendgridEmailing::Backend.new(api_key: ENV.fetch("SENDGRID_API_KEY"))
end
```The `MartenSendgridEmailing::Backend` class needs to be initialized using a [Sendgrid API key](https://docs.sendgrid.com/ui/account-and-settings/api-keys). You should ensure that this value is kept secret and that it's not hardcoded in your config files.
If needed, it should be noted that you can enable [Sendgrid sandbox mode](https://docs.sendgrid.com/for-developers/sending-email/sandbox-mode) when initializing the backend object by setting the `sandbox_mode` argument to `true`:
```crystal
Marten.configure do |config|
config.emailing.backend = MartenSendgridEmailing::Backend.new(api_key: ENV.fetch("SENDGRID_API_KEY"), sandbox_mode: true)
end
```## Authors
Morgan Aubert ([@ellmetha](https://github.com/ellmetha)) and
[contributors](https://github.com/martenframework/marten-sendgrid-emailing/contributors).## License
MIT. See ``LICENSE`` for more details.