about summary refs log tree commit diff
path: root/app/mailers
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2018-01-18 19:17:25 +0100
committerGitHub <noreply@github.com>2018-01-18 19:17:25 +0100
commitd799921c75e7bfb83504bb79dcc1c269c91d168c (patch)
tree8150e8c3d81038ed132127d2ea1ca2a44ff73fb1 /app/mailers
parente56404be414ff2fc7ff11171fdd2b31a0658aa11 (diff)
Replace tutorial modal with welcome e-mail (#6273)
* Remove onboarding modal

* Welcome e-mail

* Send welcome e-mail after confirmation

* Remove obsolete translations
Diffstat (limited to 'app/mailers')
-rw-r--r--app/mailers/user_mailer.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/app/mailers/user_mailer.rb b/app/mailers/user_mailer.rb
index a7efa73c1..4104f6cd2 100644
--- a/app/mailers/user_mailer.rb
+++ b/app/mailers/user_mailer.rb
@@ -54,4 +54,15 @@ class UserMailer < Devise::Mailer
       mail to: @resource.email, subject: I18n.t('devise.mailer.email_changed.subject')
     end
   end
+
+  def welcome(user)
+    @resource = user
+    @instance = Rails.configuration.x.local_domain
+
+    return if @resource.disabled?
+
+    I18n.with_locale(@resource.locale || I18n.default_locale) do
+      mail to: @resource.email, subject: I18n.t('user_mailer.welcome.subject')
+    end
+  end
 end