Skip to contents

Combined dataset of email sends/clicks/opens from Tessitura / WordFly and data from p2_stream. Features included are:

  • group_customer_no, customer_no

  • timestamp : date of email event

  • event_type : "Email"

  • event_subtype : "Open", "Click", "Unsubscribe', "Hard Bounce", "Forward", etc.

  • campaign_no, appeal_no, source_no

  • extraction_desc, source_desc

  • eaddress : email address

  • domain : domain of email (everything after the @)

  • email_[subtype]_count

  • email_[subtype]_timestamp_min

  • email_[subtype]_timestamp_max

Usage

email_data(..., from_date = as.POSIXct("1900-01-01"), to_date = now())

email_data_append(email_stream, ...)

email_fix_timestamp(email_stream)

email_fix_eaddress(email_stream)

email_subtype_features(email_stream)

email_stream_base(from_date = as.POSIXct("1900-01-01"), to_date = now(), ...)

email_stream_chunk(from_date = as.POSIXct("1900-01-01"), to_date = now(), ...)

email_stream_write_partition(email_stream, table_name = "email_stream_full")

email_stream(from_date = as.POSIXct("1900-01-01"), to_date = now(), ...)

Arguments

...

Arguments passed on to tessilake::read_sql, tessilake::read_sql

freshness

the returned data will be at least this fresh

from_date

earliest date/time for which data will be returned

to_date

latest date/time for which data will be returned

email_stream

email data from previous step

table_name

character(1) name of the cache to write out

Value

arrow::Table of email data

Functions

  • email_data(): load Tessitura email send/response data

  • email_data_append(): adds descriptive campaign/appeal/source information from Tessitura

  • email_fix_timestamp(): recalculates timestamps for sends because promote_dt is often long before the actual email send date.

  • email_fix_eaddress(): fills in email address based on time of send and the current email address for the customer, using email data from stream_from_audit

  • email_subtype_features(): sets multiple event_subtype == "open" as "forward" and builds windowed features for each event_subtype

  • email_stream_base(): produce one chunk of the base email_stream (without p2_stream or subtype features)

  • email_stream_chunk(): produce one chunk of email_stream between from_date and to_date

  • email_stream_write_partition(): write one partition of the stream to disk

  • email_stream(): appends p2 data and outputs to cache

Note

email_stream() is essentially

email_data(...) %>%
   email_data_append(...) %>%
   email_fix_timestamp(...) %>%
   email_fix_eaddress(...) %>%
   concat_tables(read_cache("p2_stream", "stream"), unify_schemas = TRUE) %>%
   email_subtype_features(...)