Skip to main content

max / makenotwork

3.4 KB · 120 lines History Blame Raw
1 //! Onboarding drip email sequence for new signups.
2
3 use crate::db::ListKind;
4 use crate::email::{Audience, Delivery, EmailClass, EmailClient};
5 use crate::error::Result;
6
7 impl EmailClient {
8 /// Step 1: Welcome email sent immediately after signup.
9 pub async fn send_onboarding_welcome(
10 &self,
11 to_user_id: crate::db::UserId,
12 to_email: &str,
13 to_name: Option<&str>,
14 host_url: &str,
15 ) -> Result<()> {
16 let subject = "Welcome to Makenotwork";
17 let body = format!(
18 r"Hi{name},
19
20 Welcome to Makenotwork: fair distribution for creatives of all kinds.
21
22 Here's what makes us different:
23 - 0% platform fee. You keep everything (minus Stripe's ~3% processing).
24 - No lock-in. Export your data, cancel anytime.
25 - Source-available. You can see how everything works.
26
27 To get started, head to your dashboard:
28 {host_url}/dashboard
29
30 You'll find a checklist there to help you set up your profile, connect Stripe, create your first project, and publish your first item.
31
32 If you have questions, reply to this email. It goes straight to a human.
33
34 - Makenotwork",
35 name = crate::email::greeting(to_name),
36 host_url = host_url,
37 );
38
39 self.dispatch(
40 EmailClass::Optional(ListKind::Marketing),
41 Audience::User(to_user_id, to_email),
42 subject,
43 &body,
44 Delivery::default(),
45 )
46 .await
47 }
48
49 /// Step 2: Profile setup tips (sent ~24h after signup).
50 pub async fn send_onboarding_profile(
51 &self,
52 to_user_id: crate::db::UserId,
53 to_email: &str,
54 to_name: Option<&str>,
55 host_url: &str,
56 ) -> Result<()> {
57 let subject = "Set up your creator profile";
58 let body = format!(
59 r"Hi{name},
60
61 A quick tip: creators with a display name and bio get more attention from fans.
62
63 Head to your account settings to add them:
64 {host_url}/dashboard (Account tab)
65
66 Your display name appears on all your projects and items. Your bio tells fans who you are and what you create.
67
68 Once your profile is set, create your first project. That's where your items live.
69
70 - Makenotwork",
71 name = crate::email::greeting(to_name),
72 host_url = host_url,
73 );
74
75 self.dispatch(
76 EmailClass::Optional(ListKind::Marketing),
77 Audience::User(to_user_id, to_email),
78 subject,
79 &body,
80 Delivery::default(),
81 )
82 .await
83 }
84
85 /// Step 3: Stripe connection guide (sent ~72h after signup).
86 pub async fn send_onboarding_stripe(
87 &self,
88 to_user_id: crate::db::UserId,
89 to_email: &str,
90 to_name: Option<&str>,
91 host_url: &str,
92 ) -> Result<()> {
93 let subject = "Start receiving payments";
94 let body = format!(
95 r"Hi{name},
96
97 To sell on Makenotwork, connect your Stripe account. It takes about 5 minutes.
98
99 {host_url}/dashboard (Payments tab)
100
101 Stripe handles payment processing at ~3% per transaction. That's the only fee. Makenotwork takes 0%.
102
103 Once connected, you can set prices on your items and start selling immediately.
104
105 - Makenotwork",
106 name = crate::email::greeting(to_name),
107 host_url = host_url,
108 );
109
110 self.dispatch(
111 EmailClass::Optional(ListKind::Marketing),
112 Audience::User(to_user_id, to_email),
113 subject,
114 &body,
115 Delivery::default(),
116 )
117 .await
118 }
119 }
120