> ## Documentation Index
> Fetch the complete documentation index at: https://docs.apollodeploy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Send emails with Rails

> Send a transactional email with the official Apollo Signal Rails SDK

The Rails gem adds configuration and a managed client around the Ruby SDK. It uses
`https://api.signal.apollodeploy.com` by default.

Before you start, [create an API key](/signal/create-an-api-key) with **Emails: Send** permission
and [verify the From domain](/signal/add-a-domain).

<Steps>
  <Step title="Install the Rails gem">
    ```bash theme={"dark"}
    bundle add apollo-deploy-signal-sdk-rails
    ```
  </Step>

  <Step title="Configure the client">
    Set `SIGNAL_API_KEY` in your Rails secrets, then create
    `config/initializers/apollo_signal.rb`:

    ```ruby theme={"dark"}
    ApolloDeploySignalSdkRails.configure do |config|
      config.default_headers = {
        "Authorization" => "Bearer #{ENV.fetch('SIGNAL_API_KEY')}"
      }
    end
    ```
  </Step>

  <Step title="Send an email">
    ```ruby theme={"dark"}
    request = ApolloDeploySignalSdkRails::SendEmailRequest.new(
      from: "auth@mail.company.com",
      to: ["alex@example.com"],
      subject: "Reset your password",
      text: "Use the secure link in your account to choose a new password."
    )

    email = ApolloDeploySignalSdkRails.rails_client.emails.send_email(body: request)
    Rails.logger.info("Apollo Signal accepted #{email['id']}")
    ```
  </Step>
</Steps>

<Note>
  Keep delivery orchestration in a service or background job when the request should not wait for
  email acceptance. The From domain must be verified in the API key's Signal project.
</Note>

<CardGroup cols={2}>
  <Card title="Ruby" icon="code" href="/signal/send-with/send-with-ruby">
    Use the core Ruby SDK outside Rails.
  </Card>

  <Card title="All SDKs" icon="code" href="/signal/send-with/sdk-overview">
    Compare every supported language and framework.
  </Card>
</CardGroup>
