DENG-3607 update braze_derived suppression list (#5484)

* DENG-3607 update braze_derived suppression list

* update table reference
This commit is contained in:
Leli 2024-05-03 01:23:49 +02:00 коммит произвёл GitHub
Родитель 7e90aed775
Коммит 38cab3f16c
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
6 изменённых файлов: 7 добавлений и 51 удалений

Просмотреть файл

@ -1,25 +1,15 @@
WITH suppressions AS (
SELECT
LOWER(email) AS email,
external_id AS email_id
LOWER(email) AS email
FROM
`moz-fx-data-shared-prod.acoustic_external.suppression_list_v1`
`moz-fx-data-shared-prod.marketing_suppression_list_derived.main_suppression_list_v1`
UNION DISTINCT
SELECT
LOWER(primary_email) AS email,
email_id
LOWER(primary_email) AS email
FROM
`moz-fx-data-shared-prod.ctms_braze.ctms_emails`
WHERE
has_opted_out_of_email = TRUE
UNION DISTINCT
SELECT
LOWER(email) AS email,
email_id
FROM
`moz-fx-data-shared-prod.acoustic_external.contact_raw_v1`
WHERE
has_opted_out_of_email = 1
)
SELECT
*

Просмотреть файл

@ -1,7 +1,5 @@
fields:
- mode: NULLABLE
name: email
type: STRING
- mode: NULLABLE
name: email_id
- name: email
mode: NULLABLE
type: STRING
description: Emails on the suppression list plus emails that have been opted out of emails in CTMS.

Просмотреть файл

@ -1,20 +1,10 @@
# expect braze suppression
---
# user 1
- email: user_1@mail.com
email_id: user_1
# user 2.0
- email: user_2@mail.com
email_id: user_2
# user 2.1 with different id - should show up
- email: user_2@mail.com
email_id: user_2_with_different_id
# user 2.2 with different email - should show up
- email: user_2_second_mail@mail.com
email_id: user_2
# user 3
- email: user_3@mail.com
email_id: user_3
# user 4
- email: user_4@mail.com
email_id: user_on_suppression_list_but_not_opted_out

Просмотреть файл

@ -1,15 +0,0 @@
# acoustic contacts
---
# user 1 - coming from acoustic
- email: user_1@mail.com
email_id: user_1
has_opted_out_of_email: 1
# user 4 - on the suppression list but not opted out of emails in Acoustic or CTMS
- email: user_4@mail.com
email_id: user_on_suppression_list_but_not_opted_out
has_opted_out_of_email: 0
# user 5 - not on the suppression list and not opted out of emails in Acoustic or CTMS
# should not show up on suppressions.
- email: user_5@mail.com
email_id: user_not_on_suppression_list_not_opted_out
has_opted_out_of_email: 0

Просмотреть файл

@ -2,14 +2,11 @@
---
# user 3
- primary_email: user_3@mail.com
email_id: user_3
has_opted_out_of_email: true
# user 4 - on the suppression list but not opted out of emails in Acoustic or CTMS
- email: user_4@mail.com
email_id: user_on_suppression_list_but_not_opted_out
has_opted_out_of_email: false
# user 5 - not on the suppression list and not opted out of emails in Acoustic or CTMS
# should not show up on suppressions.
- email: user_5@mail.com
email_id: user_not_on_suppression_list_not_opted_out
has_opted_out_of_email: false

Просмотреть файл

@ -2,13 +2,9 @@
---
# user 2.0
- email: user_2@mail.com
external_id: user_2
# user 2.1 with different id - should show up
# user 2.1 double in this list
- email: user_2@mail.com
external_id: user_2_with_different_id
# user 2.2 with different email - should show up
- email: user_2_second_mail@mail.com
external_id: user_2
# user 4 - on the suppression list but not opted out of emails in Acoustic or CTMS
- email: user_4@mail.com
external_id: user_on_suppression_list_but_not_opted_out