Handler to send emails to confirmed subscribers

This commit is contained in:
Alphonse Paix
2025-08-27 12:13:58 +02:00
parent 684519f689
commit 3ae50830f4
8 changed files with 242 additions and 23 deletions

View File

@@ -94,6 +94,15 @@ impl TestApp {
.await
.expect("Failed to execute request")
}
pub async fn post_newsletters(&self, body: serde_json::Value) -> reqwest::Response {
reqwest::Client::new()
.post(format!("{}/newsletters", self.address))
.json(&body)
.send()
.await
.expect("Failed to execute request")
}
}
async fn configure_database(config: &DatabaseSettings) -> PgPool {