Commit cbe76440f3a29df2000733e9ad2f86c190600918

Authored by Victor Costa
2 parents 966a6762 6ab04f0c

Merge branch 'email_template' into production

app/mailers/task_mailer.rb
... ... @@ -40,7 +40,8 @@ class TaskMailer < ActionMailer::Base
40 40 to: task.requestor.notification_emails,
41 41 from: self.class.generate_from(task),
42 42 subject: @email_template.present? ? @email_template.parsed_subject(template_params) : '[%s] %s' % [task.requestor.environment.name, task.target_notification_description],
43   - body: @email_template.present? ? @email_template.parsed_body(template_params) : nil
  43 + body: @email_template.present? ? @email_template.parsed_body(template_params) : nil,
  44 + content_type: @email_template.present? ? "text/html" : nil
44 45 )
45 46 end
46 47  
... ...
test/unit/task_mailer_test.rb
... ... @@ -190,6 +190,7 @@ class TaskMailerTest < ActiveSupport::TestCase
190 190 task.send(:send_notification, :cancelled).deliver
191 191 assert !ActionMailer::Base.deliveries.empty?
192 192 mail = ActionMailer::Base.deliveries.last
  193 + assert_match /text\/html/, mail.content_type
193 194 assert_equal 'template subject - example', mail.subject.to_s
194 195 assert_equal 'template body - example - my name - explanation', mail.body.to_s
195 196 end
... ...