From a31c22adb35e4899e49eddc36fc16517a3738d62 Mon Sep 17 00:00:00 2001
From: danielvincent <danielgrippi@gmail.com>
Date: Tue, 2 Nov 2010 17:59:50 -0700
Subject: [PATCH] mailer doesn't break everything anymore.  attachments are
 also inlined.

---
 app/mailers/notifier.rb                       | 5 +++--
 app/views/notifier/new_request.html.haml      | 2 +-
 app/views/notifier/request_accepted.html.haml | 2 +-
 3 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/app/mailers/notifier.rb b/app/mailers/notifier.rb
index 3e90576f17..36047d0593 100644
--- a/app/mailers/notifier.rb
+++ b/app/mailers/notifier.rb
@@ -7,7 +7,7 @@ class Notifier < ActionMailer::Base
   def new_request(recipient, sender)
     @receiver = recipient
     @sender = sender
-    attachments["diaspora_white_on_grey.png"] = ATTACHMENT 
+    attachments.inline['diaspora_white_on_grey.png'] = ATTACHMENT 
 
     mail(:to => "#{recipient.real_name} <#{recipient.email}>",
     :subject => "new Diaspora* friend request from #{@sender.real_name}", :host => APP_CONFIG[:terse_pod_url])
@@ -17,7 +17,8 @@ class Notifier < ActionMailer::Base
     @receiver = recipient
     @sender = sender
     @aspect = aspect
-    attachments["diaspora_white.png"] = ATTACHMENT 
+    attachments.inline['diaspora_white_on_grey.png'] = ATTACHMENT 
+
     mail(:to => "#{recipient.real_name} <#{recipient.email}>",
     :subject => "#{@sender.real_name} has accepted your friend request on Diaspora*", :host => APP_CONFIG[:terse_pod_url])
   end
diff --git a/app/views/notifier/new_request.html.haml b/app/views/notifier/new_request.html.haml
index d87a7c3870..1a994695a1 100644
--- a/app/views/notifier/new_request.html.haml
+++ b/app/views/notifier/new_request.html.haml
@@ -43,7 +43,7 @@
       }
   %body
     %header
-      = image_tag attachments['diaspora_white_on_grey.png'], :alt => "DIASPORA"
+      = image_tag attachments['diaspora_white_on_grey.png'].url, :alt => "DIASPORA"
     #container
       %p
         Hello #{@receiver.profile.first_name}!
diff --git a/app/views/notifier/request_accepted.html.haml b/app/views/notifier/request_accepted.html.haml
index f3359e6ac2..15ca54647c 100644
--- a/app/views/notifier/request_accepted.html.haml
+++ b/app/views/notifier/request_accepted.html.haml
@@ -43,7 +43,7 @@
       }
   %body
     %header
-      = image_tag attachments['diaspora_white_on_grey.png'], :alt => "DIASPORA"
+      = image_tag attachments['diaspora_white_on_grey.png'].url, :alt => "DIASPORA"
     #container
       %p
         Hello #{@receiver.profile.first_name}!
-- 
GitLab