+ mail :to => recipient.email, :subject => subject
+ end
+ end
+
+ private
+
+ def set_shared_template_vars
+ @root_url = root_url
+ end
+
+ def attach_project_logo
+ attachments.inline["logo.png"] = File.read(Rails.root.join("app", "assets", "images", "osm_logo_30.png"))
+ end
+
+ def attach_user_avatar(user)
+ attachments.inline["avatar.png"] = File.read(user_avatar_file_path(user))
+ end
+
+ def user_avatar_file_path(user)
+ image = user && user.image
+ if image && image.file?
+ return image.path(:small)
+ else
+ return Rails.root.join("app", "assets", "images", "users", "images", "small.png")
+ end
+ end
+
+ def with_recipient_locale(recipient)
+ I18n.with_locale Locale.available.preferred(recipient.preferred_languages) do