Sendy_Spec.md 3.4 KB

Sendy Mail List Spec

  • Using rails to get member groups from kdan cloud
  • Using gem Sequel to access sendy mysql db

Story

  • Need a one-time promotion mail list creater.
  • Need to do a/b testing on a certain event.
  • Should not bother opt-out users.
  • Should not sent to mark-as-spam users.
  • Should not sent to invalid email address.

Features

  1. To create list

    • prefix: [ZCR]
    • manually enter description
  2. To add subscriber into list

    • member_center
      • from_application (member.from_application)
      • comfirmed (member.confirmed_at)
      • location (member.identity.location)
      • language (member.identity.language)
    • iap_service
      • app_series (receipt.product.app.app_series)
      • subscription (receipt.product.subscription)
      • receipt_type (receipt.class)
      • subscription_status (kdan.subscriptions)
    • A/B Testing
      • Main version %, default 100%
  3. To prevent unsubscribed, bounced, complaint emails into the list

    • Unsubscribe flag should be considered as global
  4. To delete list

Models

Member Center

Member

add_column :members, :sendy_status, enum: [:subscribe, :unsubscribed, :complaint, :bounced]

Schedule.rb

  • update :sendy_sub_status every 15m
  • select subscribers.timestamp > 15.minutes.ago

IAP Service

Kdan

has_many :subscription_status, class: 'KdanSubscriptionStatus'

KdanSubscriptionStatus

  • product.target
  • only apply to following targets
    • Creativity 365
    • Document 365
  • Exclude
    • product.mass = true
belongs_to :kdan
{
  kdan_id:integer,
  target:string,
  stauts:[outsider, free_trial, subscribed, expired, refund, cancel]
}
  • outsider: Not subscribed yet on pack
  • free_trial: Subscription is in free trial period.
  • subscribed: Subscription is active now.
  • expired: Only for customer service/creative store offered products
  • cancel: Auto-renew canceled but current subscription not changed.
  • refund: Auto-renew canceled and current subscription rollbacked.
  • status priority based on receipts.purchase_date

Schedule.rb

  • update KdanPackSubscriptionStatus every 15m
    • select kdan_ids from kdan.updated_at in 1 hour (group a)
    • select kdan_ids from receipts.end_of_date in 1 hour (group b)
    • distinct kdan_ids (group a + group b)
    • cals_pack_subscription_status(kdan.receipts)

CR System

SendyMailList

{
  description:string,
  sendy_list_long_id:string,
  sendy_list_short_id:integer,
  select_criteria:json,
  email_count:integer,
  sendy_delete_at:datetime,
}
  • query from backup db: meber_center and iap_center
  • sequel to insert sendy list and subscriber

Views

CR System

Select Criteria

  • member_center
    • from_application
    • comfirmed
    • location
    • language
  • iap_service
    • app_series
    • pack
    • platform
    • subscription_status
  • A/B Testing
    • Main version %, default 100%

Search Result

Going to Build up Sendy list [Go]

  • List Name: [ZCR] my list
  • List Count: 100
  • List Content:
    • kdan_id, email, from_application, comfirmed, location, language, app_series, pack, platform

  • List Name: [ZCR] my list ver. A
  • List Count: 50
  • List Content:

    • kdan_id, email, from_application, comfirmed, location, language, app_series, pack, platform
  • List Name: [ZCR] my list ver. B

  • List Count: 50

  • List Content:

    • kdan_id, email, from_application, comfirmed, location, language, app_series, pack, platform