Askama message template
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user