Tahinli/forge
public0 watching
★ 0
| 1 | //! Outgoing mail. Callers queue a message with [`enqueue`]; the worker in [`worker`] sends it |
| 2 | //! through the [`Mailer`] held in `AppState`, retrying on the schedule in `forge_core::mail`. |
| 3 | //! Nothing sends mail inside a request. |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | use Future; |
| 12 | use Pin; |
| 13 | |
| 14 | use ; |
| 15 | |
| 16 | use crateAppState; |
| 17 | |
| 18 | pub use LogMailer; |
| 19 | pub use SmtpMailer; |
| 20 | |
| 21 | /// The future a [`Mailer::send`] call returns. |
| 22 | pub type SendFuture<'a> = ; |
| 23 | |
| 24 | /// A transport that delivers one message. Object-safe, so `AppState` holds it as `Arc<dyn Mailer>`. |
| 25 | |
| 26 | |
| 27 | |
| 28 | |
| 29 | |
| 30 | /// Queues one message, keyed by `idem_key`. Returns `false` when that key was already queued, so |
| 31 | /// the caller can retry without sending twice. The worker is woken to pick it up. |
| 32 | pub async |
| 33 | |
| 34 | |
| 35 | |
| 36 | |
| 37 | |
| 38 | |
| 39 | |
| 40 | |
| 41 | |
| 42 | |
| 43 | |
| 44 | |
| 45 | |
| 46 | |
| 47 | |
| 48 | |
| 49 | /// Queues a message that may carry threading headers. Same contract as [`enqueue`]. |
| 50 | pub async |
| 51 | |
| 52 | |
| 53 | |
| 54 | |
| 55 | |
| 56 | |
| 57 | |
| 58 | |
| 59 | |
| 60 | |
| 61 | |
| 62 | /// A mailer for tests. It records every message it accepts. [`FakeMailer::fail_next`] makes the |
| 63 | /// next sends fail, to exercise the retry path. |
| 64 | |
| 65 | |
| 66 | |
| 67 | |
| 68 | |
| 69 | |
| 70 | |
| 71 | |
| 72 | |
| 73 | |
| 74 | |
| 75 | |
| 76 | |
| 77 | |
| 78 | |
| 79 | |
| 80 | |
| 81 | |
| 82 | |
| 83 | |
| 84 | |
| 85 | |
| 86 | |
| 87 | |
| 88 | |
| 89 | |
| 90 | |
| 91 | |
| 92 | |
| 93 | |
| 94 | |
| 95 | |
| 96 | |
| 97 | |
| 98 | |
| 99 | |
| 100 | |
| 101 | |
| 102 | |
| 103 | |
| 104 | |
| 105 | |
| 106 | |
| 107 | |
| 108 | |
| 109 |