marten_sendgrid_emailing

Version, currently 0.1.01 version
  • 0.1.0latestFeb 11, 2023

github.com/martenframework/marten-sendgrid-emailing

A Sendgrid emailing backend for the Marten web framework.

3 stars
0 dependents
License: MIT

Installation

# Add this to your shard.yml
dependencies:
  marten_sendgrid_emailing:
    github: martenframework/marten-sendgrid-emailing
    version: ~> 0.1.0

Then run:

shards install

shard.yml

Crystal
>= 1.4.0
License
MIT
Author
Morgan Aubert

Dependencies

Runtime Dependencies

  • marten>= 0.2.0github: martenframework/marten

Development Dependencies

  • ameba~> 1.1.0github: crystal-ameba/amebadev
  • webmock*github: manastech/webmock.cr, branch: masterdev

README

Marten Sendgrid Emailing

CI CI

Marten Sendgrid Emailing provides a Sendgrid backend that can be used with Marten web framework's emailing system.

Installation

Simply add the following entry to your project's shard.yml:

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:

require "marten_sendgrid_emailing"

Then you can configure your project to use the Sendgrid backend by setting the corresponding configuration option as follows:

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. 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 when initializing the backend object by setting the sandbox_mode argument to true:

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) and contributors.

License

MIT. See LICENSE for more details.