diff --git a/README.rdoc b/README.rdoc index 79cc6cd..63f154a 100644 --- a/README.rdoc +++ b/README.rdoc @@ -134,7 +134,6 @@ From version 2.1.0 to version 3.1.x: config[:sender_address] = "deployment@example.com" config[:subject_prepend] = "[EMPTY-CAP-DEPLOY]" config[:site_name] = "Empty Example.com App" - config[:email_content_type] = "text/html" # OR "text/plain" if you want the plain text version of the email end 4. Add these two tasks to your deploy.rb: diff --git a/lib/cap_mailer.rb b/lib/cap_mailer.rb index 0a17c57..0136572 100644 --- a/lib/cap_mailer.rb +++ b/lib/cap_mailer.rb @@ -25,7 +25,7 @@ def self.configure_capistrano_mailer(&block) puts "Deprecated 'configure_capistrano_mailer'. Please update your capistrano_mailer configuration to use 'configure' instead of 'configure_capistrano_mailer'" end - self.template_root = default_base_config[:template_root] + self.prepend_view_path default_base_config[:template_root] def self.reloadable?() false end @@ -43,7 +43,8 @@ def notification_email(cap, config = {}, *args) :revision => cap.revision, :real_revision => cap.real_revision, :release_name => cap.release_name, - :release_notes => cap.release_notes, + #This does not appear to be a capistrano variable: + #:release_notes => cap.release_notes, :version_dir => cap.version_dir, :shared_dir => cap.shared_dir, :current_dir => cap.current_dir, @@ -78,13 +79,14 @@ def notification_email(cap, config = {}, *args) front = front.slice(0..x) end @repo_end = repo.sub(front, '') - - subject subject_line - recipients @config[:recipient_addresses] - from @config[:sender_address] - content_type @config[:email_content_type] - body body_data_hash + body_data_hash.each_pair do |k, v| + self.instance_variable_set("@#{k}", v) + end + + mail :subject => subject_line, + :to => @config[:recipient_addresses], + :from => @config[:sender_address] end private diff --git a/lib/capistrano/mailer.rb b/lib/capistrano/mailer.rb index 73eb2a3..3727560 100644 --- a/lib/capistrano/mailer.rb +++ b/lib/capistrano/mailer.rb @@ -14,7 +14,7 @@ module Capistrano class Configuration module CapistranoMailer def send_notification_email(cap, config = {}, *args) - CapMailer.deliver_notification_email(cap, config, *args) + CapMailer.notification_email(cap, config, *args).deliver end end diff --git a/views/cap_mailer/notification_email.text.html.erb b/views/cap_mailer/notification_email.text.html.erb deleted file mode 100644 index 8db243a..0000000 --- a/views/cap_mailer/notification_email.text.html.erb +++ /dev/null @@ -1,39 +0,0 @@ - - - - - <%= @site_name %> Notification - - - -
- -

- <%= @site_name %> <%=@task_name.titleize unless @task_name.nil? %> -

- - <% unless @site_url.nil? %> -

- View site: <%= @site_url.html_safe -%> -

- <% end %> - -

Released: <%= @date %> at <%= @time %>

- - <%= @sections.map { |section| - data = @section_data[section.to_sym] - if !data.empty? - if %w(extra_information release_data).include?(section) - render :partial => 'section_custom.html.erb', :locals => {:section_title => section, :data => data} - else - render :partial => 'section.html.erb', :locals => {:section_title => section, :data => data} - end - end - }.join.html_safe unless @sections.nil? %> -
- -

- Brought to you by: Capistrano Mailer -

- - diff --git a/views/cap_mailer/notification_email.text.plain.erb b/views/cap_mailer/notification_email.text.plain.erb deleted file mode 100644 index 0ee1f9a..0000000 --- a/views/cap_mailer/notification_email.text.plain.erb +++ /dev/null @@ -1,22 +0,0 @@ -<%= @site_name %> Notification -=========================================================== - - <%= @site_name %> <%=@task_name.titleize unless @task_name.nil? %> -=========================================================== - Brought to you by: Capistrano Mailer - http://github.com/pboling/capistrano_mailer - Released: <%= @date %> at <%= @time %> - - <%= @sections.map { |section| - data = @section_data[section.to_sym] - if !data.empty? - if %w(extra_information release_data).include?(section) - render :partial => 'section_custom.text.erb', :locals => {:section_title => section, :data => data} - else - render :partial => 'section.text.erb', :locals => {:section_title => section, :data => data} - end - end - }.join.html_safe unless @sections.nil? %> - -=========================================================== - Copyright 2009 9thBit LLC under MIT License - Copyright 2007-8 Sagebit LLC under MIT License