feat: Add email settings management and templates functionality
- Implemented email settings configuration in the admin panel, allowing for SMTP settings and notification preferences. - Created a new template for email settings with fields for SMTP host, port, username, password, sender address, and recipients. - Added JavaScript functionality to handle loading, saving, and validating email settings. - Introduced email templates management, enabling the listing, editing, and saving of email templates. - Updated navigation to include links to email settings and templates. - Added tests for email settings and templates to ensure proper functionality and validation.
This commit is contained in:
@@ -1,20 +1,41 @@
|
||||
{% extends "_base.html" %} {% block title %}Email Templates{% endblock %} {%
|
||||
block heading %}Email Templates{% endblock %} {% block extra_styles %}
|
||||
<link rel="stylesheet" href="/static/css/admin.css" /> {% endblock %} {% block
|
||||
content %}
|
||||
<div class="settings-management">
|
||||
<h2>Newsletter Confirmation Template</h2>
|
||||
<p>Edit the HTML template used for the newsletter confirmation email.</p>
|
||||
<div id="message"></div>
|
||||
<form id="templateForm">
|
||||
<div class="form-group">
|
||||
<label for="newsletterTemplate">Template HTML</label>
|
||||
<textarea id="newsletterTemplate" rows="15" cols="80"></textarea>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<button class="btn btn-primary" type="submit">Save Template</button>
|
||||
</div>
|
||||
</form>
|
||||
<link rel="stylesheet" href="/static/css/admin.css" />
|
||||
{% endblock %} {% block content %}
|
||||
<div class="email-templates-container" id="emailTemplatesPage">
|
||||
<aside
|
||||
class="email-templates-list"
|
||||
id="emailTemplatesList"
|
||||
aria-label="Available email templates"
|
||||
></aside>
|
||||
|
||||
<section class="email-template-editor">
|
||||
<div id="templateMessage" class="message" style="display: none"></div>
|
||||
<h2 id="templateTitle">Select a template to start editing</h2>
|
||||
<p id="templateDescription" class="template-description"></p>
|
||||
|
||||
<form id="emailTemplateForm">
|
||||
<div class="form-group">
|
||||
<label for="templateContent">Template HTML</label>
|
||||
<textarea
|
||||
id="templateContent"
|
||||
rows="20"
|
||||
class="template-content"
|
||||
disabled
|
||||
></textarea>
|
||||
</div>
|
||||
<div class="form-actions">
|
||||
<button
|
||||
class="btn btn-primary"
|
||||
type="submit"
|
||||
id="saveTemplateButton"
|
||||
disabled
|
||||
>
|
||||
Save Template
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</section>
|
||||
</div>
|
||||
{% endblock %} {% block extra_scripts %}
|
||||
<script src="/static/js/admin.js"></script>
|
||||
|
||||
Reference in New Issue
Block a user