Sha256: 401d22586c49db83b3b0cb3c72f98e620b67abf5ffe2966418dc84b85407e692

Contents?: true

Size: 1.56 KB

Versions: 38

Compression:

Stored size: 1.56 KB

Contents

= form.hidden_field :email_form_action, value: email_action

- if email_skip
  = form.check_box :email_form_skip, label: 'Do not send email'

= form.hide_if :email_form_skip, true do
  - if email_to.present?
    = form.static_field :email_form_to, label: 'To', value: (email_to.try(:email) || email_to)

  - if form.object.errors.present?
    = form.select :email_form_from, mailer_froms_collection(), label: 'From'
    = form.text_field :email_form_subject, label: 'Subject'
    = form.text_area :email_form_body, label: 'Body', rows: 10

  - elsif email_template.present?
    -# email_template is an Effective::EmailTemplate
    - from_value = email_template.from || EffectiveResources.mailer_froms.first
    = form.select :email_form_from, mailer_froms_collection(), label: 'From', value: from_value
    = form.text_field :email_form_subject, label: 'Subject', value: email_template.subject
    = form.text_area :email_form_body, label: 'Body', value: email_template.body, rows: 10

  - else
    - from_value = email_defaults[:from] || EffectiveResources.mailer_froms.first
    = form.select :email_form_from, mailer_froms_collection(), label: 'From', value: from_value
    = form.text_field :email_form_subject, label: 'Subject', value: (email_defaults[:subject] || '')
    = form.text_area :email_form_body, label: 'Body', rows: 10, value: (email_defaults[:body] || '')

  - if email_variables.present?
    %p The available variables are:

    %ul
      - email_variables.each do |variable|
        %li {{ #{variable} }}

    %small.text-muted Please contact us to add additional variables

Version data entries

38 entries across 38 versions & 1 rubygems

Version Path
effective_resources-2.22.2 app/views/effective/acts_as_email_form/_fields.html.haml
effective_resources-2.22.1 app/views/effective/acts_as_email_form/_fields.html.haml
effective_resources-2.22.0 app/views/effective/acts_as_email_form/_fields.html.haml
effective_resources-2.20.5 app/views/effective/acts_as_email_form/_fields.html.haml
effective_resources-2.20.4 app/views/effective/acts_as_email_form/_fields.html.haml
effective_resources-2.20.3 app/views/effective/acts_as_email_form/_fields.html.haml
effective_resources-2.20.2 app/views/effective/acts_as_email_form/_fields.html.haml
effective_resources-2.20.1 app/views/effective/acts_as_email_form/_fields.html.haml
effective_resources-2.20.0 app/views/effective/acts_as_email_form/_fields.html.haml
effective_resources-2.19.13 app/views/effective/acts_as_email_form/_fields.html.haml
effective_resources-2.19.12 app/views/effective/acts_as_email_form/_fields.html.haml
effective_resources-2.19.11 app/views/effective/acts_as_email_form/_fields.html.haml
effective_resources-2.19.10 app/views/effective/acts_as_email_form/_fields.html.haml
effective_resources-2.19.9 app/views/effective/acts_as_email_form/_fields.html.haml
effective_resources-2.19.8 app/views/effective/acts_as_email_form/_fields.html.haml
effective_resources-2.19.7 app/views/effective/acts_as_email_form/_fields.html.haml
effective_resources-2.19.6 app/views/effective/acts_as_email_form/_fields.html.haml
effective_resources-2.19.5 app/views/effective/acts_as_email_form/_fields.html.haml
effective_resources-2.19.4 app/views/effective/acts_as_email_form/_fields.html.haml
effective_resources-2.19.3 app/views/effective/acts_as_email_form/_fields.html.haml