Reddirt
Reddirt

Reputation: 5953

Rails Heroku Sendgrid send to one address in staging

We are using Heroku (Staging and Production) with Sendgrid for a Rails 3 app.

Is there a way to have all the emails generated in Staging re-directed to one address. When testing, we don't want to actually do things like email invoices to our customers.

If not, would we need to program the logic into the mailer?

Thanks for the help!

Upvotes: 2

Views: 238

Answers (2)

Obromios
Obromios

Reputation: 16393

You can also use the recipient_interceptor gem.

Upvotes: 0

Andrei Stangacianu
Andrei Stangacianu

Reputation: 283

You can hardcode the 'to' address in the mailer file.

mail(to: "[email protected]", subject: "A new comment has been added to #{list}", from: "[email protected]")

Upvotes: 1

Related Questions