@@ -103,6 +103,169 @@ Easily manage subscriptions with unique links for each list. Embed these links o
103103
104104![ Subscribe] ( assets/screenshots/nimletter_subscribe.drawio.svg )
105105
106+ ## Events
107+
108+ ### Send immediate mail
109+ ``` sh
110+ curl -X POST \
111+ -H " Content-Type: application/json" \
112+ -H " Authorization: Bearer YOUR_API_KEY" \
113+ -d ' {
114+ "event": "email-send",
115+ "email": "nim@nimletter.com",
116+ "mail": "welcome-mail",
117+ "delay": 0
118+ }' \
119+ http://localhost:5555/api/event
120+ ```
121+
122+ ### Send mail after 40 minutes
123+ ``` sh
124+ curl -X POST \
125+ -H " Content-Type: application/json" \
126+ -H " Authorization: Bearer YOUR_API_KEY" \
127+ -d ' {
128+ "event": "email-send",
129+ "email": "nim@nimletter.com",
130+ "mail": "first-login",
131+ "delay": 40
132+ }' \
133+ http://localhost:5555/api/event
134+ ```
135+
136+ ### Send mail with custom content and subject
137+ ``` sh
138+ curl -X POST \
139+ -H " Content-Type: application/json" \
140+ -H " Authorization: Bearer YOUR_API_KEY" \
141+ -d ' {
142+ "event": "email-send",
143+ "email": "nim@nimletter.com",
144+ "content": "<div>Custom content</div>",
145+ "subject": "Custom subject",
146+ "delay": 40
147+ }' \
148+ http://localhost:5555/api/event
149+ ```
150+
151+ ### Cancel mail
152+ ``` sh
153+ curl -X POST \
154+ -H " Content-Type: application/json" \
155+ -H " Authorization: Bearer YOUR_API_KEY" \
156+ -d ' {
157+ "event": "email-cancel",
158+ "email": "nim@nimletter.com",
159+ "mail": "welcome-mail"
160+ }' \
161+ http://localhost:5555/api/event
162+ ```
163+
164+ ### Create contact
165+ ``` sh
166+ curl -X POST \
167+ -H " Content-Type: application/json" \
168+ -H " Authorization: Bearer YOUR_API_KEY" \
169+ -d ' {
170+ "event": "contact-create",
171+ "email": "mail@nimletter.com",
172+ "name": "Nim Letter",
173+ "double_opt_in": false,
174+ "flow_step": 1
175+ }' \
176+ http://localhost:5555/api/event
177+ ```
178+
179+ ### Create contact and add to list
180+ ``` sh
181+ curl -X POST \
182+ -H " Content-Type: application/json" \
183+ -H " Authorization: Bearer YOUR_API_KEY" \
184+ -d ' {
185+ "event": "contact-create",
186+ "email": "mail@nimletter.com",
187+ "name": "Nim Letter",
188+ "double_opt_in": false,
189+ "flow_step": 1,
190+ "list": "list-identifier"
191+ }' \
192+ http://localhost:5555/api/event
193+ ```
194+
195+ ### Create contact and add to list with optin email
196+ ``` sh
197+ curl -X POST \
198+ -H " Content-Type: application/json" \
199+ -H " Authorization: Bearer YOUR_API_KEY" \
200+ -d ' {
201+ "event": "contact-create",
202+ "email": "mail@nimletter.com",
203+ "name": "Nim Letter",
204+ "double_opt_in": true,
205+ "flow_step": 1,
206+ "list": "list-identifier"
207+ }' \
208+ http://localhost:5555/api/event
209+ ```
210+
211+ ### Transfer contact from other system
212+ ``` sh
213+ curl -X POST \
214+ -H " Content-Type: application/json" \
215+ -H " Authorization: Bearer YOUR_API_KEY" \
216+ -d ' {
217+ "event": "contact-create",
218+ "email": "mail@nimletter.com",
219+ "name": "Nim Letter",
220+ "double_opt_in": false,
221+ "flow_step": 3,
222+ "list": "list-identifier,list-identifier2"
223+ }' \
224+ http://localhost:5555/api/event
225+ ```
226+
227+ ### Update (replace) contact (contactID OR email required)
228+ ``` sh
229+ curl -X POST \
230+ -H " Content-Type: application/json" \
231+ -H " Authorization: Bearer YOUR_API_KEY" \
232+ -d ' {
233+ "event": "contact-update",
234+ "email": "nim@nimletter.com",
235+ "name": "Nim Letter",
236+ "status": "enabled",
237+ "double_opt_in": false,
238+ "opted_in": false,
239+ "meta": "{\"country\":\"Denmark\",\"language\":\"DK\"}"
240+ }' \
241+ http://localhost:5555/api/event
242+ ```
243+
244+ ### Update meta-tags
245+ ``` sh
246+ curl -X POST \
247+ -H " Content-Type: application/json" \
248+ -H " Authorization: Bearer YOUR_API_KEY" \
249+ -d ' {
250+ "event": "contact-meta",
251+ "email": "nim@nimletter.com",
252+ "meta": "{\"country\":\"Denmark\",\"nim\":\"lang\"}"
253+ }' \
254+ http://localhost:5555/api/event
255+ ```
256+
257+ ### Contact exists
258+ ``` sh
259+ curl -X POST \
260+ -H " Content-Type: application/json" \
261+ -H " Authorization: Bearer YOUR_API_KEY" \
262+ -d ' {
263+ "event": "contact-exists",
264+ "email": "mail@nimletter.com"
265+ }' \
266+ http://localhost:5555/api/event
267+ ```
268+
106269
107270# 🚀 Startup
108271
@@ -274,6 +437,11 @@ https://heroicons.com/
274437 * ~~Move mail sending to another dedicated sender thread with synchronous channel (queue)~~
275438 * SQLite support
276439 * Moving JS to TypeScript
440+ * API testing with Bruno
277441* User stuff
278442 * Captcha for subscribe
279443 * User managed pages for "subscribe" and "unsubscribe" and "optin"
444+ * Frontend
445+ * Better overview of user and their interactions
446+ * Which links the user clicked on
447+ * Better overview in flows of open and click rates and users
0 commit comments