# Resend Ruby and Rails SDK [](https://opensource.org/licenses/MIT)  [](https://badge.fury.io/rb/resend) --- ## Installation To install Resend Ruby and Rails SDK, simply execute the following command in a terminal: Via RubyGems: ``` gem install resend ``` Via Gemfile: ``` gem 'resend' ``` ## Setup First, you need to get an API key, which is available in the [Resend Dashboard](https://resend.com). ```ruby require "resend" Resend.api_key = ENV["RESEND_API_KEY"] ``` or ```ruby require "resend" Resend.configure do |config| config.api_key = ENV["RESEND_API_KEY"] end ``` The `#api_key` method also accepts a block without arguments, which can be useful for lazy or dynamic loading of API keys. ```ruby require "resend" Resend.api_key = -> { ENV["RESEND_API_KEY"] } ``` ```ruby Resend.configure do |config| config.api_key = -> { Current.user.resend_api_key } # Assumes the user has a `resend_api_key` attribute. end ``` ## Example ```rb require "resend" Resend.api_key = ENV["RESEND_API_KEY"] params = { "from": "from@email.io", "to": ["to@email.com", "to1@gmail.com"], "html": "