You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
docuseal/app/views/email_smtp_settings/index.html.erb

62 lines
3.4 KiB

<div class="max-w-4xl mx-auto space-y-8">
<h1 class="text-3xl md:text-4xl font-bold tracking-tight text-base-content">Email SMTP</h1>
<section class="bg-base-100 rounded-xl border border-base-300 p-6 md:p-8 shadow-soft">
<h2 class="text-lg font-semibold text-base-content mb-5"><%= t('smtp_configuration', default: 'SMTP Configuration') %></h2>
<% value = @encrypted_config.value || {} %>
<%= form_for @encrypted_config, url: settings_email_index_path, method: :post, html: { autocomplete: 'off', class: 'space-y-4' } do |f| %>
<%= f.fields_for :value do |ff| %>
<div class="grid md:grid-cols-2 gap-4">
<div class="form-control">
<%= ff.label :host, 'Host', class: 'label' %>
<%= ff.text_field :host, value: value['host'], required: true, class: 'base-input' %>
</div>
<div class="form-control">
<%= ff.label :port, 'Port', class: 'label' %>
<%= ff.text_field :port, value: value['port'], required: true, class: 'base-input' %>
</div>
</div>
<div class="grid md:grid-cols-2 gap-4">
<div class="form-control">
<%= ff.label :username, 'Username', class: 'label' %>
<%= ff.text_field :username, value: value['username'], class: 'base-input' %>
</div>
<div class="form-control">
<%= ff.label :password, 'Password', class: 'label' %>
<%= ff.password_field :password, class: 'base-input', required: value['password'].present?, placeholder: value['password'].present? ? '*************' : '' %>
</div>
</div>
<div class="grid md:grid-cols-2 gap-4">
<div class="form-control">
<%= ff.label :domain, "Domain (#{t('optional')})", class: 'label' %>
<%= ff.text_field :domain, value: value['domain'], class: 'base-input' %>
</div>
<div class="form-control">
<%= ff.label :authentication, 'Authentication', class: 'label' %>
<%= ff.select :authentication, options_for_select([%w[Plain plain], %w[Login login], %w[CRAM-MD5 cram_md5]], value.fetch('authentication', 'plain')), { prompt: true }, required: true, class: 'base-select' %>
</div>
</div>
<% if !Docuseal.multitenant? || can?(:manage, :personalization_advanced) %>
<div class="form-control">
<%= ff.label :security_label, 'SMTP Security', class: 'label' %>
<div class="flex items-center space-x-6">
<% [%w[STARTTLS none], %w[TLS tls], %w[SSL ssl], %w[Noverify noverify]].each do |(label, val)| %>
<%= ff.label :security, value: val, for: "#{val}_radio", class: 'label' do %>
<%= ff.radio_button :security, val, checked: (value['security'].blank? && val == 'none') || value['security'] == val, id: "#{val}_radio", class: 'base-radio mr-2' %>
<%= label %>
<% end %>
<% end %>
</div>
</div>
<% end %>
<div class="form-control">
<%= ff.label :from_email, t('send_from_email'), class: 'label' %>
<%= ff.email_field :from_email, value: value['from_email'], required: !Docuseal.multitenant?, class: 'base-input' %>
</div>
<% end %>
<div class="form-control pt-2">
<%= f.button button_title(title: t('save'), disabled_with: t('saving')), class: 'base-button' %>
</div>
<% end %>
</section>
</div>