mirror of
https://github.com/docusealco/docuseal.git
synced 2026-08-07 07:14:43 +00:00
add reset smtp action
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
class EmailSmtpSettingsController < ApplicationController
|
||||
before_action :load_encrypted_config
|
||||
authorize_resource :encrypted_config, only: :index
|
||||
authorize_resource :encrypted_config, parent: false, only: :create
|
||||
authorize_resource :encrypted_config, parent: false, only: %i[create destroy]
|
||||
|
||||
def index; end
|
||||
|
||||
@@ -23,6 +23,12 @@ class EmailSmtpSettingsController < ApplicationController
|
||||
render :index, status: :unprocessable_content
|
||||
end
|
||||
|
||||
def destroy
|
||||
@encrypted_config.destroy!
|
||||
|
||||
redirect_to settings_email_index_path, notice: I18n.t('smtp_settings_have_been_reset')
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def load_encrypted_config
|
||||
|
||||
@@ -57,6 +57,11 @@
|
||||
<%= f.button button_title(title: t('save'), disabled_with: t('saving')), class: 'base-button' %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% if Docuseal.multitenant? && @encrypted_config.persisted? %>
|
||||
<div class="flex justify-center pt-2">
|
||||
<%= button_to t('reset_default'), settings_email_path(@encrypted_config), method: :delete, class: 'link', data: { turbo_confirm: t('are_you_sure_') } %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="w-0 md:w-52"></div>
|
||||
</div>
|
||||
|
||||
@@ -12,12 +12,12 @@
|
||||
<li>
|
||||
<%= link_to t('account'), settings_account_path, class: 'text-base hover:bg-base-300' %>
|
||||
</li>
|
||||
<% if (!Docuseal.multitenant? || EncryptedConfig.exists?(key: EncryptedConfig::EMAIL_SMTP_KEY, account: current_account)) && can?(:read, EncryptedConfig.new(key: EncryptedConfig::EMAIL_SMTP_KEY, account: current_account)) && ENV['SMTP_ADDRESS'].blank? && true_user == current_user %>
|
||||
<li>
|
||||
<%= link_to t('email'), settings_email_index_path, class: 'text-base hover:bg-base-300' %>
|
||||
</li>
|
||||
<% end %>
|
||||
<% unless Docuseal.multitenant? %>
|
||||
<% if can?(:read, EncryptedConfig.new(key: EncryptedConfig::EMAIL_SMTP_KEY, account: current_account)) && ENV['SMTP_ADDRESS'].blank? && true_user == current_user %>
|
||||
<li>
|
||||
<%= link_to t('email'), settings_email_index_path, class: 'text-base hover:bg-base-300' %>
|
||||
</li>
|
||||
<% end %>
|
||||
<% if can?(:read, EncryptedConfig.new(key: EncryptedConfig::FILES_STORAGE_KEY, account: current_account)) && true_user == current_user && ENV['S3_ATTACHMENTS_BUCKET'].blank? && ENV['GCS_BUCKET'].blank? && ENV['AZURE_CONTAINER'].blank? %>
|
||||
<li>
|
||||
<%= link_to t('storage'), settings_storage_index_path, class: 'text-base hover:bg-base-300' %>
|
||||
|
||||
@@ -899,6 +899,7 @@ en: &en
|
||||
mobile: Mobile
|
||||
tablet: Tablet
|
||||
reset_default: Reset default
|
||||
smtp_settings_have_been_reset: SMTP settings have been reset.
|
||||
send_signature_request_email: Send signature request email
|
||||
last_3_months: Last 3 months
|
||||
last_6_months: Last 6 months
|
||||
@@ -1975,6 +1976,7 @@ es: &es
|
||||
mobile: Móvil
|
||||
tablet: Tableta
|
||||
reset_default: Restablecer por defecto
|
||||
smtp_settings_have_been_reset: La configuración SMTP ha sido restablecida.
|
||||
send_signature_request_email: Enviar correo de solicitud de firma
|
||||
last_3_months: Últimos 3 meses
|
||||
last_6_months: Últimos 6 meses
|
||||
@@ -3051,6 +3053,7 @@ it: &it
|
||||
mobile: Mobile
|
||||
tablet: Tablet
|
||||
reset_default: Reimposta predefinito
|
||||
smtp_settings_have_been_reset: Le impostazioni SMTP sono state ripristinate.
|
||||
send_signature_request_email: Invia email di richiesta firma
|
||||
last_3_months: Ultimi 3 mesi
|
||||
last_6_months: Ultimi 6 mesi
|
||||
@@ -4123,6 +4126,7 @@ fr: &fr
|
||||
mobile: Mobile
|
||||
tablet: Tablette
|
||||
reset_default: Réinitialiser par défaut
|
||||
smtp_settings_have_been_reset: Les paramètres SMTP ont été réinitialisés.
|
||||
send_signature_request_email: Envoyer un e-mail de demande de signature
|
||||
last_month: Mois dernier
|
||||
last_3_months: 3 derniers mois
|
||||
@@ -5200,6 +5204,7 @@ pt: &pt
|
||||
mobile: Celular
|
||||
tablet: Tablet
|
||||
reset_default: Redefinir para padrão
|
||||
smtp_settings_have_been_reset: As configurações SMTP foram redefinidas.
|
||||
send_signature_request_email: Enviar e-mail de solicitação de assinatura
|
||||
last_3_months: Últimos 3 meses
|
||||
last_6_months: Últimos 6 meses
|
||||
@@ -6276,6 +6281,7 @@ de: &de
|
||||
mobile: Mobil
|
||||
tablet: Tablet
|
||||
reset_default: Standard zurücksetzen
|
||||
smtp_settings_have_been_reset: Die SMTP-Einstellungen wurden zurückgesetzt.
|
||||
send_signature_request_email: Signaturanfrage-E-Mail senden
|
||||
last_3_months: Letzte 3 Monate
|
||||
last_6_months: Letzte 6 Monate
|
||||
@@ -7753,6 +7759,7 @@ nl: &nl
|
||||
mobile: Mobiel
|
||||
tablet: Tablet
|
||||
reset_default: Standaard herstellen
|
||||
smtp_settings_have_been_reset: De SMTP-instellingen zijn hersteld.
|
||||
send_signature_request_email: E-mail met handtekeningaanvraag verzenden
|
||||
last_3_months: Afgelopen 3 maanden
|
||||
last_6_months: Afgelopen 6 maanden
|
||||
|
||||
+1
-1
@@ -189,7 +189,7 @@ Rails.application.routes.draw do
|
||||
resources :api, only: %i[index create], controller: 'api_settings'
|
||||
resource :reveal_access_token, only: %i[show create], controller: 'reveal_access_token'
|
||||
end
|
||||
resources :email, only: %i[index create], controller: 'email_smtp_settings'
|
||||
resources :email, only: %i[index create destroy], controller: 'email_smtp_settings'
|
||||
resources :sso, only: %i[index], controller: 'sso_settings'
|
||||
resources :notifications, only: %i[index create], controller: 'notifications_settings'
|
||||
resource :esign, only: %i[show create new update destroy], controller: 'esign_settings'
|
||||
|
||||
Reference in New Issue
Block a user