Sha256: d80a9d808bd137660b11a0f3f0353129206dca88a777967eeef10412ad21e9b6

Contents?: true

Size: 636 Bytes

Versions: 2

Compression:

Stored size: 636 Bytes

Contents

class NewEmailVariants < Scrivener
  attr_accessor :email, :button_template

  def validate
    assert_member :button_template, %w{sp_em_small sp_em_large}

    if assert_present :email
      email.each do |e|

        if assert !e["email_subject"].nil?, [:email_subject, :nil]
          assert !e["email_subject"].empty?, [:email_subject, :empty]
        end

        if assert !e["email_body"].nil?, [:email_body, :nil]

          if assert !e["email_body"].empty?, [:email_body, :empty]
            assert e["email_body"].include?("{LINK}"), [:email_body, :link_not_included]
          end

        end

      end
    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
shareprogress-0.0.2 lib/shareprogress/filters/new_email_variants.rb
shareprogress-0.0.1 lib/shareprogress/filters/new_email_variants.rb