BigW Consortium Gitlab

profile.rb 783 Bytes
Newer Older
1 2
module Emails
  module Profile
3
    def new_user_email(user_id, token = nil)
Douwe Maan committed
4
      @current_user = @user = User.find(user_id)
5
      @target_url = user_url(@user)
6
      @token = token
7
      mail(to: @user.notification_email, subject: subject("Account was created for you"))
8 9
    end

10 11
    def new_email_email(email_id)
      @email = Email.find(email_id)
Douwe Maan committed
12
      @current_user = @user = @email.user
13
      mail(to: @user.notification_email, subject: subject("Email was added to your account"))
14 15
    end

16
    def new_ssh_key_email(key_id)
17 18 19 20
      @key = Key.find_by_id(key_id)

      return unless @key

Douwe Maan committed
21
      @current_user = @user = @key.user
22
      @target_url = user_url(@user)
23
      mail(to: @user.notification_email, subject: subject("SSH key was added to your account"))
24 25 26
    end
  end
end