effective_email_templates 1.0.10 → 1.0.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6ed72c520b24e50d1102d0e89a4e353c399d8b0f6e95e44bb872e7dc75e6805e
4
- data.tar.gz: b0cf351fffa4982b8bb9d6e8665cde74bdcefc02c4a551d03d7eaf29ed21b96c
3
+ metadata.gz: dd45246572ae7b8d6eab683d911aba2fb4d74e2b9ac9f805fb6faea71ebef8b6
4
+ data.tar.gz: b37ed1adc75b8773d6c5caa57510e434b4537c2512bc63d1adf7b36d1ebe2939
5
5
  SHA512:
6
- metadata.gz: 02d5add10f230239034b43148b5c6efc73da5a886ffcaa62cebdb36e34ee3bbaa368f3fd5fb830289fb46952cad7ff9bcc49ccb6610f6a1ad535c615bd784380
7
- data.tar.gz: fa8fdfdc3408a0e778ab6510363c77d8d7704cb0dd9cabac69882b28cdc9dea9bcd607ee723421114afdde9e64a3e626a6b53e1103d0d7680c26ba9746290f4a
6
+ metadata.gz: 93297ce10d8e17183bd52a0c89cf393c42182a7ac4875669ac375f775a9a166770d7d6ffec1f7c9c385e4f40cb8f74e2f240ad2d428bc8b09dd2b4d8ddaaf5c4
7
+ data.tar.gz: 16a24643ba98a5ad269071eb992e3c73ae7f4d02cbab1c331b083cce8d45ad231e8c8a22a554e547aa94fb748aa98d62f5199a8391f6723778e889b50e5d8b03
@@ -2,6 +2,7 @@ module EffectiveEmailTemplatesHelper
2
2
 
3
3
  # We are given a form to essentially send an email
4
4
  def effective_email_review_fields(form, template_name, mail = nil)
5
+ raise('expected a mail object') if mail && !mail.kind_of?(ActionMailer::MessageDelivery)
5
6
  raise('expected form.object to respond to email_review') unless form.object.respond_to?(:email_review)
6
7
 
7
8
  email_review = form.object.email_review
@@ -9,11 +10,10 @@ module EffectiveEmailTemplatesHelper
9
10
  unless email_review&.template_name == template_name.to_s
10
11
  email_template = Effective::EmailTemplate.where(template_name: template_name).first!
11
12
  email_review = Effective::EmailReview.build(email_template: email_template)
12
- end
13
13
 
14
- if mail.present?
15
- raise('expected a mail object') unless mail.kind_of?(ActionMailer::MessageDelivery)
16
- email_review.body ||= mail.message.body
14
+ if mail.present?
15
+ email_review.body = mail.message.body
16
+ end
17
17
  end
18
18
 
19
19
  render(partial: 'effective/email_reviews/fields', locals: { email_review: email_review, form: form })
@@ -1,3 +1,3 @@
1
1
  module EffectiveEmailTemplates
2
- VERSION = '1.0.10'.freeze
2
+ VERSION = '1.0.11'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_email_templates
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.10
4
+ version: 1.0.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect