Askama message template

This commit is contained in:
Alphonse Paix
2025-09-20 00:51:46 +02:00
parent 6ad207d0a4
commit 2b9cf979e8
9 changed files with 29 additions and 33 deletions

View File

@@ -3,7 +3,7 @@ use crate::{
idempotency::{IdempotencyKey, save_response, try_processing},
routes::{AdminError, enqueue_delivery_tasks, insert_newsletter_issue},
startup::AppState,
templates::SuccessTemplate,
templates::MessageTemplate,
};
use anyhow::Context;
use askama::Template;
@@ -68,8 +68,8 @@ pub async fn create_post(
// Send emails with unique identifiers that contains link to blog post with special param
// Get handpoint that returns the post and mark the email as opened
let template = SuccessTemplate {
success_message: "Your new post has been saved. Subscribers will be notified.".into(),
let template = MessageTemplate::Success {
message: "Your new post has been saved. Subscribers will be notified.".into(),
};
let response = Html(template.render().unwrap()).into_response();
save_response(transaction, &idempotency_key, user_id, response)