]> git.openstreetmap.org Git - rails.git/blobdiff - app/mailers/user_mailer.rb
Merge remote-tracking branch 'upstream/pull/3758'
[rails.git] / app / mailers / user_mailer.rb
index e0f3bb5f6e0a7968fac3f37c4be8681b9177f366..33fcc7465a6fb8a056448032556dbf7c577b0b7c 100644 (file)
@@ -12,7 +12,7 @@ class UserMailer < ApplicationMailer
 
   def signup_confirm(user, token)
     with_recipient_locale user do
-      @url = url_for(:controller => "users", :action => "confirm",
+      @url = url_for(:controller => "confirmations", :action => "confirm",
                      :display_name => user.display_name,
                      :confirm_string => token.token)
 
@@ -24,7 +24,7 @@ class UserMailer < ApplicationMailer
   def email_confirm(user, token)
     with_recipient_locale user do
       @address = user.new_email
-      @url = url_for(:controller => "users", :action => "confirm_email",
+      @url = url_for(:controller => "confirmations", :action => "confirm_email",
                      :confirm_string => token.token)
 
       mail :to => user.new_email,
@@ -34,7 +34,7 @@ class UserMailer < ApplicationMailer
 
   def lost_password(user, token)
     with_recipient_locale user do
-      @url = url_for(:controller => "users", :action => "reset_password",
+      @url = url_for(:controller => "passwords", :action => "reset_password",
                      :token => token.token)
 
       mail :to => user.email,
@@ -83,7 +83,7 @@ class UserMailer < ApplicationMailer
 
       mail :from => from_address(message.sender.display_name, "m", message.id, message.digest),
            :to => message.recipient.email,
-           :subject => I18n.t("user_mailer.message_notification.subject_header", :subject => message.title)
+           :subject => t(".subject", :message_title => message.title)
     end
   end
 
@@ -183,7 +183,7 @@ class UserMailer < ApplicationMailer
   end
 
   def attach_project_logo
-    attachments.inline["logo.png"] = File.read(Rails.root.join("app/assets/images/osm_logo_30.png"))
+    attachments.inline["logo.png"] = Rails.root.join("app/assets/images/osm_logo_30.png").read
   end
 
   def attach_user_avatar(user)
@@ -194,13 +194,12 @@ class UserMailer < ApplicationMailer
     avatar = user&.avatar
     if avatar&.attached?
       if avatar.variable?
-        image = avatar.variant(:resize => "50x50>").processed
-        image.service.download(image.key)
+        avatar.variant(:resize_to_limit => [50, 50]).download
       else
         avatar.blob.download
       end
     else
-      File.read(Rails.root.join("app/assets/images/avatar_small.png"))
+      Rails.root.join("app/assets/images/avatar_small.png").read
     end
   end