Sha256: c96a8ac670e3cd35727a1c58785d09979dc41eace1e3fcb374269e4c659ee255

Contents?: true

Size: 1.46 KB

Versions: 2

Compression:

Stored size: 1.46 KB

Contents

= 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|
  = f.static_field :template_name, label: 'Name'

  - if EffectiveEmailTemplates.select_content_type
    = f.select :content_type, Effective::EmailTemplate::CONTENT_TYPES

  = f.select :from, mailer_froms_collection(), hint: 'Please contact us to add additional sender addresses. Please refresh the page if this from address looks weird.'
  = f.text_field :cc
  = f.text_field :bcc

  - prefix_hint = EffectiveResources.mailer_subject_prefix_hint.to_s.strip.presence
  = f.text_field :subject, hint: (prefix_hint ? "The subject of your email. It will be automatically prefixed with: #{prefix_hint}" : 'The subject of your email')

  = f.show_if(:content_type, Effective::EmailTemplate::CONTENT_TYPE_PLAIN) do
    = f.text_area :body, hint: 'The text/plain content of your email template', rows: 10
  
  = f.show_if(:content_type, Effective::EmailTemplate::CONTENT_TYPE_HTML) do
    = f.article_editor :body, hint: 'The text/html content of your email template', mode: :email

  = card do
    %p The available variables for this email template are:

    %ul
      - Array(f.object.template_variables).each do |variable|
        %li {{ #{variable} }}

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

  = f.submit do
    = f.save 'Save'
    = f.save 'Continue'

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
effective_email_templates-1.9.0 app/views/admin/email_templates/_form.html.haml
effective_email_templates-1.8.0 app/views/admin/email_templates/_form.html.haml