Email COnfigs & setup

This commit is contained in:
IGNY8 VPS (Salman)
2026-01-08 05:41:28 +00:00
parent 7da3334c03
commit 3651ee9ed4
34 changed files with 2418 additions and 77 deletions

View File

@@ -0,0 +1,78 @@
{% extends "admin/base_site.html" %}
{% load i18n %}
{% block content %}
<div style="max-width: 800px; margin: 0 auto; padding: 20px;">
<div style="background: white; border-radius: 8px; padding: 24px; box-shadow: 0 1px 3px rgba(0,0,0,0.1);">
<h2 style="margin-top: 0; color: #1f2937;">Test Email: {{ template.display_name }}</h2>
<div style="background: #f8fafc; border-radius: 6px; padding: 16px; margin-bottom: 24px;">
<p style="margin: 0 0 8px 0; color: #64748b; font-size: 14px;">
<strong>Template Path:</strong> {{ template.template_path }}
</p>
<p style="margin: 0 0 8px 0; color: #64748b; font-size: 14px;">
<strong>Type:</strong> {{ template.get_template_type_display }}
</p>
<p style="margin: 0; color: #64748b; font-size: 14px;">
<strong>Description:</strong> {{ template.description|default:"No description" }}
</p>
</div>
<form method="post" action="{% url 'admin:system_emailtemplate_send_test' template.pk %}">
{% csrf_token %}
<div style="margin-bottom: 20px;">
<label style="display: block; font-weight: 500; color: #374151; margin-bottom: 8px;">
Send Test Email To:
</label>
<input type="email" name="to_email" value="{{ user.email }}"
style="width: 100%; padding: 12px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 14px;"
placeholder="recipient@example.com" required>
</div>
<div style="margin-bottom: 20px;">
<label style="display: block; font-weight: 500; color: #374151; margin-bottom: 8px;">
Subject (Preview):
</label>
<input type="text" disabled value="[TEST] {{ template.default_subject }}"
style="width: 100%; padding: 12px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 14px; background: #f9fafb; color: #6b7280;">
</div>
<div style="margin-bottom: 20px;">
<label style="display: block; font-weight: 500; color: #374151; margin-bottom: 8px;">
Context Variables (JSON):
</label>
<textarea name="context" rows="8"
style="width: 100%; padding: 12px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 13px; font-family: monospace;"
placeholder='{"user_name": "Test User", "account_name": "Test Account"}'>{{ template.sample_context|default:"{}"|safe }}</textarea>
<p style="color: #6b7280; font-size: 12px; margin-top: 4px;">
Required variables: {{ template.required_context|default:"None specified"|safe }}
</p>
</div>
<div style="display: flex; gap: 12px;">
<button type="submit"
style="background: #6366f1; color: white; padding: 12px 24px; border: none;
border-radius: 6px; font-weight: 500; cursor: pointer; font-size: 14px;">
📧 Send Test Email
</button>
<a href="{% url 'admin:system_emailtemplate_changelist' %}"
style="background: #e5e7eb; color: #374151; padding: 12px 24px;
border-radius: 6px; font-weight: 500; text-decoration: none; font-size: 14px;">
Cancel
</a>
</div>
</form>
</div>
<div style="background: #fef3c7; border-radius: 8px; padding: 16px; margin-top: 20px;">
<h4 style="margin: 0 0 8px 0; color: #92400e;">⚠️ Testing Tips</h4>
<ul style="margin: 0; padding-left: 20px; color: #78350f; font-size: 14px;">
<li>Test emails are prefixed with [TEST] in the subject line</li>
<li>Make sure your Resend API key is configured in Integration Providers</li>
<li>Use sample_context to pre-fill test data for this template</li>
<li>Check Email Logs after sending to verify delivery status</li>
</ul>
</div>
</div>
{% endblock %}