From fc9b8f6ef4933a6096c7f49e6d281dc045dba467 Mon Sep 17 00:00:00 2001 From: Martin Lensment Date: Wed, 22 Apr 2015 13:13:44 +0300 Subject: [PATCH] Add test emails --- app/mailers/invoice_mailer.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/mailers/invoice_mailer.rb b/app/mailers/invoice_mailer.rb index 072386fa1..51c370994 100644 --- a/app/mailers/invoice_mailer.rb +++ b/app/mailers/invoice_mailer.rb @@ -1,5 +1,10 @@ class InvoiceMailer < ApplicationMailer def invoice_email(invoice, pdf) + unless Rails.env.production? + test_emails = ['martin@gitlab.eu', 'priit@gitlab.eu'] + return unless test_emails.include?(invoice.billing_email) + end + attachments[invoice.pdf_name] = pdf mail(to: invoice.billing_email, subject: invoice) end