- Implemented `send_subscription_confirmation` function to send a confirmation email upon subscription. - Added a default HTML template for the confirmation email in settings. - Updated the newsletter management page to handle subscription and unsubscription actions. - Created new templates for embedding contact and newsletter forms. - Added styles for the new templates and unified CSS styles across the application. - Updated tests to reflect changes in the newsletter management API endpoints.
27 lines
775 B
Python
27 lines
775 B
Python
"""Embeddable forms routes."""
|
|
from __future__ import annotations
|
|
|
|
from flask import Blueprint, render_template, send_from_directory
|
|
import os
|
|
|
|
bp = Blueprint("embed", __name__)
|
|
|
|
|
|
@bp.route("/embed/contact", methods=["GET"])
|
|
def contact_form():
|
|
"""Serve the embeddable contact form."""
|
|
return render_template("embed_contact.html")
|
|
|
|
|
|
@bp.route("/embed/newsletter", methods=["GET"])
|
|
def newsletter_form():
|
|
"""Serve the embeddable newsletter subscription form."""
|
|
return render_template("embed_newsletter.html")
|
|
|
|
|
|
@bp.route("/static/css/styles.css", methods=["GET"])
|
|
def serve_css():
|
|
"""Serve the unified CSS file."""
|
|
static_dir = os.path.join(os.path.dirname(__file__), '..', '..', 'static')
|
|
return send_from_directory(static_dir, 'css/styles.css')
|