---
title: SendGrid
description: Połącz SendGrid, poznaj sposób synchronizacji i wysyłaj zapytania do wszystkich zapisywanych tabel i kolumn.
species: reference
---
# SendGrid

Połącz SendGrid za pomocą klucza API. Źródło zapisuje 6 stałych tabel w schemacie `titan.sendgrid`.
```sql
select
  id,
  email,
  first_name
from titan.sendgrid.contacts
limit 10
```

## Połącz SendGrid

1. Otwórz **Aplikacje**, wybierz **Połącz aplikację**, a następnie **SendGrid**.
2. Podaj klucz API.
3. Sprawdź tabele, a następnie zapisz źródło.
4. Obserwuj **Historię synchronizacji**, aż pierwsze uruchomienie się zakończy.

Dane uwierzytelniające są przechowywane jako sekrety. Nigdy nie stają się kolumnami jeziora ani nie pojawiają się w wynikach zapytań.

## Sposób synchronizacji

Kontakty, listy, kampanie, szablony wiadomości e-mail, blokady wysyłki i globalne rezygnacje z subskrypcji są synchronizowane razem.

Nowe źródło synchronizuje się po połączeniu, a następnie zgodnie z harmonogramem. Domyślny interwał cykliczny wynosi 4 godziny. Przerwane uruchomienie zachowuje ukończone postępy i jest bezpiecznie ponawiane.

Każda tabela jeziora ma też [kolumny systemowe](/docs/concepts/your-lake#kolumny-systemowe) `_synced_at` i `_deleted`; poniższa dokumentacja kolumn obejmuje wyłącznie kolumny źródłowe.

## Dokumentacja tabel

### `contacts`

`titan.sendgrid.contacts` ma 9 kolumn źródłowych.

```columns table=sendgrid.contacts
id                                      string pk           Pole źródłowe `id`.
email                                   string              Pole źródłowe `email`.
first_name                              string              Pole źródłowe `firstName`.
last_name                               string              Pole źródłowe `lastName`.
city                                    string              Pole źródłowe `city`.
country                                 string              Pole źródłowe `country`.
created_at                              datetime            Pole źródłowe `createdAt`.
updated_at                              datetime            Pole źródłowe `updatedAt`.
custom_fields                           json                Pole źródłowe `customFields`.
```

### `lists`

`titan.sendgrid.lists` ma 5 kolumn źródłowych.

```columns table=sendgrid.lists
id                                      string pk           Pole źródłowe `id`.
name                                    string              Pole źródłowe `name`.
contact_count                           integer             Pole źródłowe `contactCount`.
created_at                              datetime            Pole źródłowe `createdAt`.
updated_at                              datetime            Pole źródłowe `updatedAt`.
```

### `campaigns`

`titan.sendgrid.campaigns` ma 6 kolumn źródłowych.

```columns table=sendgrid.campaigns
id                                      string pk           Pole źródłowe `id`.
name                                    string              Pole źródłowe `name`.
status                                  string              Pole źródłowe `status`.
send_at                                 datetime            Pole źródłowe `sendAt`.
created_at                              datetime            Pole źródłowe `createdAt`.
updated_at                              datetime            Pole źródłowe `updatedAt`.
```

### `templates`

`titan.sendgrid.templates` ma 4 kolumny źródłowe.

```columns table=sendgrid.templates
id                                      string pk           Pole źródłowe `id`.
name                                    string              Pole źródłowe `name`.
generation                              string              Pole źródłowe `generation`.
updated_at                              datetime            Pole źródłowe `updatedAt`.
```

### `suppressions`

`titan.sendgrid.suppressions` ma 4 kolumny źródłowe.

```columns table=sendgrid.suppressions
email                                   string pk           Pole źródłowe `email`.
reason                                  string              Pole źródłowe `reason`.
status                                  string              Pole źródłowe `status`.
created_at                              datetime            Pole źródłowe `createdAt`.
```

### `global_unsubscribes`

`titan.sendgrid.global_unsubscribes` ma 2 kolumny źródłowe.

```columns table=sendgrid.global_unsubscribes
email                                   string pk           Pole źródłowe `email`.
created                                 datetime            Pole źródłowe `created`.
```

## Usunięcia i historia

Wiersze są scalane według klucza źródłowego. Gdy źródło może potwierdzić usunięcie wiersza, Supernova zachowuje go i ustawia `_deleted`, dzięki czemu zapytania mogą zdecydować, czy uwzględniać historię. Aby pobierać bieżący stan, filtruj zapytania przez `where not _deleted`.
