Try   HackMD

隨買即用系統 (購票流程自動化) - (RFC) Phase1

本 spec 是用 ShapeUp principle from BaseCamp 寫的

Problem

  1. 花人工:進入 Gather town 聽演講需要拿到 invitation link, 而目前的流程是需要 人工 匯入 kktix 的售票紀錄後,才能送 invitation link 的 email 給 user
  2. Cannot maximize our revenue: 因為需要人工寄信給他,所以我們過去會提前截止,讓人類有時間能寄信給會眾

本次專案的目標,是希望能讓收到 gather town 等 invitation link 的流程自動化,做到隨買即用。

Appetite

(解釋一下,ShapeUp 的原則是根據時間 time frame 決定我們能實作多少功能,而不是想做多少功能去預估要做多久;Spec 服務時間,而不是時間服務Spec )

21 days 希望七月底 ship to prod

Solution

Extractor
Transformer
Loader
Data Warehouse
Authorizer e.g. Gather Town or YouTube
Email

In short, 這是個 data pipeline. 可以用任何語言任何框架去實作,框架部分如 Airflow or crontab 都行,只要能每五分鐘或 semi-realtime 的把最新的 kktix event 吃進來都蠻理想的。

  • Extractor:
  • Transformer: need to de-identify, 用 sha256 to hash user's email should be enough
  • Loader: there's many BigQuery python SDK allowing us to load data to BigQuery ref
  • Data Warehouse: Destination for these kktix raw data should be (根據資料類型決定送到哪個 table):
    1. pycontw-225217.ods.ods_kktix_ticket_corporate_attendees
    2. pycontw-225217.ods.ods_kktix_ticket_individual_attendees
    3. pycontw-225217.ods.ods_kktix_ticket_reserved_attendees
  • Authorizer:
    1. Gather Town: TBD(完全不知道這邊怎麼加白名單然後產生 invitation link)
    2. Youtube: 直接給 private link
  • Email:
    • main logic is as follow:
      Image Not Showing Possible Reasons
      • The image file may be corrupted
      • The server hosting the image is unavailable
      • The image path is incorrect
      • The image format is not supported
      Learn More →
      1. create template
      2. create a list (list 是一群已購票用戶的 email 列表)
      3. create campaign
      4. send or schedule this campaign
    • 用 Klaviyo API 去寄信,請不要使用自幹的 SMTP 發 Email 給 user,缺點是自幹的話無法追蹤開信率、點擊率等等,但付錢給 ESP 的話這些數據都追得到,能讓我們更好的了解銷售漏斗(詳請請查 Sales Funnel, Marketing Funnel)

Rabbit Holes

  1. Airflow infra 可能不穩定,如果掛了資料就會 delay 而且目前沒有 uptime monitoring service 會通知我們他掛了
  2. Authorizer: Gather Town 的 API 不知道誰熟
  3. ESP: 不知道我們決定買哪一家,那一家的 API 可能沒人研究過不知道怎麼 post(不過理論上他們的 document 不會寫太爛才對)
    我用過mailgun, API簡單好用, 前5000封信免費 (by derick)
    KKTIX 也是用 mailgun,之前也有請弘哲研究 (by GTB)

No Gos

correct me if I'm wrong, 但看起來最緊急的是自動寄 email 給 user, discord command 是 nice to have

Scopes

  • Extractor @davidtnfsh
    • KKTIX API @yfRGNNkIRbuSG29WjF3SdQ
  • Transformer @davidtnfsh
    • Making sure we use SHA256 to de-identify their email and name
  • Loader @davidtnfsh
    • load de-identified data into ods bq dataset
    • installed bq SDK
  • Data Warehouse @davidtnfsh
    • making sure data is available in BQ dataset
  • Authorizer
    • do some research about how to whitelist emails in Gather Town
    • 應該會拿到 unique 的 GatherTown invite link(?)
  • Email
    • 研究 ESP
    • 或是用 SMTP 自幹

Gather Town API document

https://www.notion.so/Gather-HTTP-API-3bbf6c59325f40aca7ef5ce14c677444#3c526203a2d543879841dae77dbe3ed5

set guest email example
https://forum.gather.town/t/is-https-gather-town-api-setemailguestlist-supposed-to-set-a-users-role/101

Reference

https://hackmd.io/TqAet6zNTTifRa4wzE__RA?view