Skip to main content

sofie_mail/web/
mod.rs

1//! What reaches sofie-mail over HTTP: unsubscribes from bulk mail and the mail provider's
2//! reports of bounces and complaints, each suppressing an address.
3
4mod events;
5mod page;
6
7use sofie_core::Result;
8use sofie_db::{Outcome, Plan, Stamp};
9use sofie_http::{Routes, Web};
10
11pub use events::Events;
12
13use crate::suppression::Suppression;
14
15pub fn routes(routes: &mut Routes<Web>, events: &Events) {
16    page::routes(routes);
17    events.routes(routes);
18}
19
20pub(crate) struct Suppressed(pub(crate) Option<Suppression>);
21
22impl Outcome for Suppressed {
23    fn plan(&self, plan: &mut Plan<'_>) -> Result<()> {
24        self.0.plan(plan)
25    }
26
27    fn committed(&mut self, stamp: Stamp) {
28        self.0.committed(stamp);
29    }
30}