mirror of https://github.com/docusealco/docuseal
parent
ae7690047b
commit
d99365138d
@ -0,0 +1,27 @@
|
|||||||
|
<% locked = AccountConfig.locked_by_env?(AccountConfig::EMAIL_FOOTER_MESSAGE_KEY) %>
|
||||||
|
<%= form_for config, url: settings_notifications_path, method: :post, html: { autocomplete: 'off', class: 'space-y-4' } do |f| %>
|
||||||
|
<%= f.hidden_field :key %>
|
||||||
|
<div class="form-control">
|
||||||
|
<%= f.label :value, class: 'label' do %>
|
||||||
|
<span class="flex items-center space-x-1">
|
||||||
|
<span><%= t('email_footer_message') %></span>
|
||||||
|
<span class="tooltip" data-tip="<%= t('email_footer_help') %>">
|
||||||
|
<%= svg_icon('info_circle', class: 'w-4 h-4') %>
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
<% end %>
|
||||||
|
<autoresize-textarea>
|
||||||
|
<%= f.text_area :value, class: 'base-input w-full py-2', rows: 3, disabled: locked, dir: 'auto' %>
|
||||||
|
</autoresize-textarea>
|
||||||
|
<% if locked %>
|
||||||
|
<label class="label">
|
||||||
|
<span class="label-text-alt"><%= t('locked_by_env') %></span>
|
||||||
|
</label>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
<% unless locked %>
|
||||||
|
<div class="form-control pt-2">
|
||||||
|
<%= f.button button_title(title: t('save'), disabled_with: t('updating')), class: 'base-button' %>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
@ -0,0 +1,25 @@
|
|||||||
|
import { test, expect } from '@playwright/test';
|
||||||
|
import { loginAsAdmin } from './helpers/auth';
|
||||||
|
|
||||||
|
// Phase 2.1 — Global email footer.
|
||||||
|
// Sets a footer via Notifications settings and verifies it saves.
|
||||||
|
// Actual mail rendering is validated manually with letter_opener in dev.
|
||||||
|
|
||||||
|
test.describe('Email footer', () => {
|
||||||
|
test('admin can configure an email footer message', async ({ page }) => {
|
||||||
|
await loginAsAdmin(page);
|
||||||
|
await page.goto('/settings/notifications');
|
||||||
|
|
||||||
|
const textarea = page.locator('textarea[name="account_config[value]"]').first();
|
||||||
|
await expect(textarea).toBeVisible();
|
||||||
|
|
||||||
|
const footer = `CONFIDENTIAL - ${Date.now()}`;
|
||||||
|
await textarea.fill(footer);
|
||||||
|
await page.getByRole('button', { name: /save|update/i }).first().click();
|
||||||
|
await page.waitForLoadState('networkidle');
|
||||||
|
|
||||||
|
// Reload and ensure the saved footer persists.
|
||||||
|
await page.goto('/settings/notifications');
|
||||||
|
await expect(page.locator('textarea').filter({ hasText: footer }).first()).toBeVisible();
|
||||||
|
});
|
||||||
|
});
|
||||||
Loading…
Reference in new issue