effective_email_templates 1.0.8 → 1.0.9
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 +4 -4
- data/app/datatables/effective_email_templates_datatable.rb +2 -1
- data/app/models/effective/email_template.rb +14 -0
- data/app/views/admin/email_templates/_form.html.haml +3 -1
- data/config/effective_email_templates.rb +3 -0
- data/lib/effective_email_templates.rb +1 -0
- data/lib/effective_email_templates/version.rb +1 -1
- metadata +6 -6
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 1051f0fdea5606d0c44e97e4a9b8776ebec40ed2e9ad53dd9bedb11ea07fec92
         | 
| 4 | 
            +
              data.tar.gz: e9c20eaa1d0b59b010d9cf35ec493e0f5fe0b9278efaf8165109298ab27eabd9
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 780ff3d0e553a9b463de798b3a66504adf4594ba907dd98857b6185c7f27267c4d0e47d9ac456b4c64ba4b9b2075be8080bf30f84bb62100b94f95167980d49d
         | 
| 7 | 
            +
              data.tar.gz: a965fd38e92b81d5ca9d892248d75a16267af7dd0df9a1c5aacccbe1842cd083bbb3b30676d3db85f13b9a1ffb460347ba49cbcec700db19e5f5542d314c46e3
         | 
| @@ -14,6 +14,8 @@ class EffectiveEmailTemplatesDatatable < Effective::Datatable | |
| 14 14 | 
             
                col :subject
         | 
| 15 15 | 
             
                col :body
         | 
| 16 16 |  | 
| 17 | 
            +
                col :content_type, visible: false
         | 
| 18 | 
            +
             | 
| 17 19 | 
             
                actions_col partial: '/admin/email_templates/actions', partial_as: 'email_template'
         | 
| 18 20 | 
             
              end
         | 
| 19 21 |  | 
| @@ -21,4 +23,3 @@ class EffectiveEmailTemplatesDatatable < Effective::Datatable | |
| 21 23 | 
             
                Effective::EmailTemplate.all
         | 
| 22 24 | 
             
              end
         | 
| 23 25 | 
             
            end
         | 
| 24 | 
            -
             | 
| @@ -44,6 +44,20 @@ module Effective | |
| 44 44 | 
             
                validates :content_type, presence: true, inclusion: { in: CONTENT_TYPES }
         | 
| 45 45 | 
             
                validates :template_name, presence: true
         | 
| 46 46 |  | 
| 47 | 
            +
                # validate(if: -> { content_type == 'text/html' && body.present? }) do
         | 
| 48 | 
            +
                #   unless body.include?('<') && body.include?('>')
         | 
| 49 | 
            +
                #     self.errors.add(:content_type, 'expected html tags in body')
         | 
| 50 | 
            +
                #     self.errors.add(:body, 'expected html tags in body')
         | 
| 51 | 
            +
                #   end
         | 
| 52 | 
            +
                # end
         | 
| 53 | 
            +
             | 
| 54 | 
            +
                # validate(if: -> { content_type == 'text/plain' && body.present? }) do
         | 
| 55 | 
            +
                #   if body.include?('</a>') || body.include?('</p>')
         | 
| 56 | 
            +
                #     self.errors.add(:content_type, 'expected no html tags in body')
         | 
| 57 | 
            +
                #     self.errors.add(:body, 'expected no html tags in body')
         | 
| 58 | 
            +
                #   end
         | 
| 59 | 
            +
                # end
         | 
| 60 | 
            +
             | 
| 47 61 | 
             
                def to_s
         | 
| 48 62 | 
             
                  template_name.presence || 'New Email Template'
         | 
| 49 63 | 
             
                end
         | 
| @@ -1,6 +1,8 @@ | |
| 1 1 | 
             
            = effective_form_with(model: email_template, url: email_template.persisted? ? effective_email_templates.admin_email_template_path(email_template.id) : effective_email_templates.admin_email_templates_path) do |f|
         | 
| 2 2 | 
             
              = f.static_field :template_name, label: 'Name'
         | 
| 3 | 
            -
             | 
| 3 | 
            +
             | 
| 4 | 
            +
              - if EffectiveEmailTemplates.select_content_type
         | 
| 5 | 
            +
                = f.select :content_type, Effective::EmailTemplate::CONTENT_TYPES
         | 
| 4 6 |  | 
| 5 7 | 
             
              = f.email_field :from, hint: 'Whom the email will be sent from'
         | 
| 6 8 | 
             
              = f.text_field :cc
         | 
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: effective_email_templates
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 1.0. | 
| 4 | 
            +
              version: 1.0.9
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Code and Effect
         | 
| 8 | 
            -
            autorequire: | 
| 8 | 
            +
            autorequire:
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2020- | 
| 11 | 
            +
            date: 2020-08-13 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: rails
         | 
| @@ -119,7 +119,7 @@ homepage: https://github.com/code-and-effect/effective_email_templates | |
| 119 119 | 
             
            licenses:
         | 
| 120 120 | 
             
            - MIT
         | 
| 121 121 | 
             
            metadata: {}
         | 
| 122 | 
            -
            post_install_message: | 
| 122 | 
            +
            post_install_message:
         | 
| 123 123 | 
             
            rdoc_options: []
         | 
| 124 124 | 
             
            require_paths:
         | 
| 125 125 | 
             
            - lib
         | 
| @@ -134,8 +134,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement | |
| 134 134 | 
             
                - !ruby/object:Gem::Version
         | 
| 135 135 | 
             
                  version: '0'
         | 
| 136 136 | 
             
            requirements: []
         | 
| 137 | 
            -
            rubygems_version: 3. | 
| 138 | 
            -
            signing_key: | 
| 137 | 
            +
            rubygems_version: 3.1.2
         | 
| 138 | 
            +
            signing_key:
         | 
| 139 139 | 
             
            specification_version: 4
         | 
| 140 140 | 
             
            summary: Effective Email Templates provides an admin access to modify email templates
         | 
| 141 141 | 
             
            test_files: []
         |