26
Sending Subscribers Surveys with Ghost, PipeDream and AirTable
This is not an "how to" guide, but me explaining my own pipeline to myself as a coherence check, and so I can remember what I have running in the future. If you want to deploy a similar project and have questions, you know where the comment section is.
I've recently created a newsletter with a peculiar gimmick: every month(?) paid users (members) receive a survey to decide the topic of the following month. I want to automate this process as much as possible.

Here's an overview of the pipeline. Unfortunately, Excalidraw's sharing features aren't working right now, so I can't link to a larger version.
1) When a new user signs up as a member, their data is stored in Ghost's own internal DB. Technically, a webhook event is emitted at this stage, but I couldn't get it to work for my purpose (mostly because I couldn't figure out whether they were a paying member upon subscription).
2) Every two hours, a scheduled PipeDream job uses the Ghost API to fetch members and store them in AirTable. This job is independent from the rest of the pipeline, so I can use this table for all future membership-based actions.
2) Every two hours, a scheduled PipeDream job uses the Ghost API to fetch members and store them in AirTable. This job is independent from the rest of the pipeline, so I can use this table for all future membership-based actions.
1) Every two hours, a scheduled PipeDream job fetches all surveys with status
2) For each user, PipeDream uses the MailerSend API to send an email with the survey template. Surveys have a
3) For all successful emails sent, the member is then added in the
in progress
, and all the members who are eligible to receive them. Then, it creates a list of all the non-surveyed members for each survey.2) For each user, PipeDream uses the MailerSend API to send an email with the survey template. Surveys have a
subscriber_email
parameters, which is used to pre-fill (and skip) the email step of the survey.3) For all successful emails sent, the member is then added in the
sent_to
column of the Surveys table. This prevents repeated emails.1) SurveySparrow triggers a PipeDream webhook when a survey gets a new answer.
2) The webhook triggers the "Register Survey Answer" pipeline, which uses the
3) The Member with the corresponding email is added to the
2) The webhook triggers the "Register Survey Answer" pipeline, which uses the
subscriber_email
param to retrieve the member that filled the survey. If the param is not present, the survey will display a question asking for the email explicitly, and that will be used instead. 3) The Member with the corresponding email is added to the
answered_by
column in the Surveys table.subscriber_email
param to fake submitting the survey as someone else. This isn't a huge deal for my use case, but a workaround would be to create a unique identifier per survey sent that can then be traced back to the original users.26