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

Tom Hughes notifications at github.com
Thu May 18 11:08:38 UTC 2017


tomhughes 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 was going to say much the same thing, even without considering the non-null enum nature of it.

-- 
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#discussion_r117219878
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20170518/000790ad/attachment.html>


More information about the rails-dev mailing list