@@ -138,157 +138,3 @@ runner->>browser: HTTP 302 redirect response
138138
139139note over user,runner: User completes the rest of the questions
140140```
141-
142- ### User submits their form
143- ``` mermaid
144-
145- ---
146- title: User submits their form
147- ---
148-
149- sequenceDiagram
150-
151- autonumber
152-
153- actor user as User
154-
155- participant browser as Browser
156-
157- participant runner as Forms Runner
158- participant runner-db as Forms Runner database
159- participant solidqueue-db as Solid Queue database
160-
161- browser->>runner: GET check your answers
162- runner->>browser: HTTP 200 response
163- browser->>user: display check your answers page
164-
165- user->>browser: select "Submit"
166- browser->>runner: POST submit form
167- runner->>runner-db: save Submission
168- runner->>solidqueue-db: enqueue send submission job
169-
170- runner->>browser: HTTP 302 response
171- browser->>runner: GET confirmation page
172- runner->>browser: HTTP 200 response
173- browser->>user: Display confirmation page
174-
175- ```
176-
177- ### Sending the submission email asynchronously
178-
179- ``` mermaid
180-
181- ---
182- title: Sending the submission email asynchronously
183- ---
184-
185- sequenceDiagram
186-
187- autonumber
188-
189- participant worker as Forms runner worker
190- participant solidqueue-db as Solid Queue database
191- participant runner-db as Forms Runner database
192- participant s3 as Amazon S3
193- participant ses as Amazon SES
194- participant sns as Amazon SNS
195- participant inbox as Email inbox
196- participant sentry as Sentry
197-
198- actor processor
199-
200- worker->>solidqueue-db: dequeue send submission job
201- worker->>runner-db: get Submission
202- worker->>s3: get file(s)
203- worker->>ses: send email
204-
205- break error
206- alt AWS SDK error and max retries not reached
207- worker->>solidqueue-db: schedule retry
208- else
209- worker->>sentry: send error
210- end
211- end
212-
213- ses->>worker: return message_id
214- worker->>runner-db: set mail_message_id on Submission
215- worker->>runner-db: update mail_status of Submission to "pending"
216-
217- ses-)inbox: send email
218- note over ses,inbox: happens some time later
219-
220- alt email sent successfully
221- ses->>sns: send delivery notification
222- processor->>inbox: get form from inbox
223- processor->>processor: process form
224- else email bounces
225- ses->>sns: send bounce notification
226- note over ses,sns: We have an SQS queue subscribed to the<br/> SNS topic and a recurring task to poll<br/>the SQS queue.
227- end
228-
229- worker->>worker: Recurring task deletes Submissions<br/>that haven't bounced after 7 days
230- ```
231-
232- ### Handling email bounces/complaints
233- ``` mermaid
234-
235- ---
236- title: Handling email bounces/complaints
237- ---
238-
239- sequenceDiagram
240-
241- autonumber
242-
243- participant worker as Solid Queue worker
244- participant solidqueue-db as Solid Queue database
245- participant runner-db as Forms Runner database
246- participant sqs as Amazon SQS
247- participant sentry as Sentry
248-
249- actor support as Forms team tech support
250-
251- worker->>solidqueue-db: enqueue recurring receive bounces job
252- worker->>solidqueue-db: dequeue receive bounces job
253- worker->>sqs: get messages from bounces and complaints queue
254- alt there is a bounce SQS message
255- worker->>runner-db: get Submission by the message_id in the SQS message
256- worker->>runner-db: update mail_status of Submission to "bounced"
257- worker->>worker: Log with the submission details
258- worker->>sentry: send error event
259- sentry->>support: Alert via Slack
260- support->>support: Identify why the email bounced
261- support->>support: Run rake task to retry submission
262- else there is a complaint SQS message
263- worker->>runner-db: get Submission by the message_id in the SQS message
264- worker->>worker: Log with the submission details
265- end
266-
267- ```
268-
269- ### Handling successful deliveries
270-
271- ``` mermaid
272-
273- ---
274- title: Handling successful deliveries
275- ---
276-
277- sequenceDiagram
278-
279- autonumber
280-
281- participant worker as Solid Queue worker
282- participant solidqueue-db as Solid Queue database
283- participant runner-db as Forms Runner database
284- participant sqs as Amazon SQS
285-
286- actor support as Forms team tech support
287-
288- worker->>solidqueue-db: enqueue recurring receive deliveries job
289- worker->>solidqueue-db: dequeue receive deliveries job
290- worker->>sqs: get messages from deliveries queue
291- worker->>runner-db: get Submission by the message_id in the SQS message
292- worker->>runner-db: update mail_status of Submission to "delivered"
293- note over worker,runner-db: we don't currently use the "delivered" status for anything other than for information
294- ```
0 commit comments