[openstreetmap/openstreetmap-website] Add a preferred_email_format preference (#1511)

Andy Allan notifications at github.com
Thu May 18 10:34:44 UTC 2017


gravitystorm commented on this pull request.



>      end
   end
 
   private
 
+  def compose_mail(recipient, options = {})
+    needs_avatar = options.include? :attach_avatar
+    avatar_user = options.delete :attach_avatar
+    options[:to] ||= recipient.email
+    mail(options) do |format|
+      if recipient.preferred_email_format == "text_only"
+        format.text
+      else
+        unless recipient.preferred_email_format == "multipart"
+          logger.warn "Unknown email format '#{recipient.preferred_email_format}, treated as 'multipart'"
+        end

I think this guard isn't necessary. We're selecting from a column that is an "enum ... NOT NULL" so it won't be possible for an unknown email format to be saved.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/1511#pullrequestreview-38900214
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20170518/aa1de2cf/attachment.html>


More information about the rails-dev mailing list