---
title: "Email Marketing"
description: "Kampanjat. Jokainen sovellus on moduuli samalla tietomallilla."
canonical: "https://obop-platform.sliplane.app/fi/apps/email-marketing/"
lang: "fi"
---

# Email Marketing

## Mihin se on tarkoitettu

Keep mailing lists with each contact's consent status and date, and prepare campaigns. Sending reaches real people and cannot be undone, so it always needs a human approval.

## Mitä paketti tekee ja mitä ei

Mailing lists, the contacts on them with their consent status and date, and campaigns with a draft, scheduled, sent flow. Sending is irreversible and reaches real people, so it needs a human approval from a manager; agents may only propose it. Campaign statistics are numbers entered or imported, not computed. Contacts are personal data: keep consent_status and consent_date accurate and never mail a contact that is not opted_in.

## Mallit

### `email_marketing_list`

A mailing list contacts can belong to

Lukuryhmä: `email_marketing.user`. Kirjoitusryhmä: `email_marketing.manager`.

| Kenttä | Tyyppi | Tietoluokka | Henkilötieto | Ryhmä | Agentit näkevät | Kuvaus |
|---|---|---|---|---|---|---|
| `name` | text | `none` | ei | `email_marketing.user` | selkoisena | List name, for example Newsletter |
| `description` | longtext | `none` | ei | `email_marketing.user` | selkoisena | What subscribers receive |
| `is_public` | bool | `none` | ei | `email_marketing.user` | selkoisena | Whether visitors can subscribe themselves |

### `email_marketing_contact`

A person on a mailing list

Lukuryhmä: `email_marketing.user`. Kirjoitusryhmä: `email_marketing.user`.

| Kenttä | Tyyppi | Tietoluokka | Henkilötieto | Ryhmä | Agentit näkevät | Kuvaus |
|---|---|---|---|---|---|---|
| `list_id` | ref → email_marketing_list | `none` | ei | `email_marketing.user` | selkoisena | The list the contact is on |
| `email` | text | `internal` | kyllä | `email_marketing.user` | maskattu | Email address |
| `name` | text | `internal` | kyllä | `email_marketing.user` | maskattu | Name of the contact |
| `consent_status` | select (pending, opted_in, opted_out, bounced) | `internal` | kyllä | `email_marketing.user` | maskattu | Permission to mail: pending, opted_in, opted_out, bounced |
| `consent_date` | date | `internal` | kyllä | `email_marketing.user` | maskattu | Day the contact gave or withdrew permission (YYYY-MM-DD) |
| `consent_source` | text | `internal` | kyllä | `email_marketing.user` | maskattu | Where consent was collected, for example website signup form |

### `email_marketing_campaign`

One mailing sent to a list

Lukuryhmä: `email_marketing.user`. Kirjoitusryhmä: `email_marketing.user`.

| Kenttä | Tyyppi | Tietoluokka | Henkilötieto | Ryhmä | Agentit näkevät | Kuvaus |
|---|---|---|---|---|---|---|
| `name` | text | `none` | ei | `email_marketing.user` | selkoisena | Internal campaign name |
| `subject` | text | `none` | ei | `email_marketing.user` | selkoisena | Email subject line |
| `preview_text` | text | `none` | ei | `email_marketing.user` | selkoisena | Short text shown after the subject in inboxes |
| `from_name` | text | `none` | ei | `email_marketing.user` | selkoisena | Sender name shown to recipients |
| `from_email` | text | `none` | ei | `email_marketing.user` | selkoisena | Sender address shown to recipients |
| `list_id` | ref → email_marketing_list | `none` | ei | `email_marketing.user` | selkoisena | The list the campaign goes to |
| `body` | longtext | `none` | ei | `email_marketing.user` | selkoisena | Email content (HTML or Markdown, as the sender expects) |
| `scheduled_for` | date | `none` | ei | `email_marketing.user` | selkoisena | Day the campaign is to be sent (YYYY-MM-DD) |
| `sent_on` | date | `none` | ei | `email_marketing.user` | selkoisena | Day the campaign was sent (YYYY-MM-DD) |
| `sent_count` | number | `none` | ei | `email_marketing.user` | selkoisena | Emails handed to the mail server |
| `delivered_count` | number | `none` | ei | `email_marketing.user` | selkoisena | Emails accepted by recipients' servers |
| `opened_count` | number | `none` | ei | `email_marketing.user` | selkoisena | Recipients who opened the email |
| `clicked_count` | number | `none` | ei | `email_marketing.user` | selkoisena | Recipients who clicked a link |
| `bounced_count` | number | `none` | ei | `email_marketing.user` | selkoisena | Emails that bounced |
| `unsubscribed_count` | number | `none` | ei | `email_marketing.user` | selkoisena | Recipients who unsubscribed because of this campaign |
| `state` | select (draft, scheduled, sent, cancelled) | `none` | ei | `email_marketing.user` | selkoisena | Campaign status: draft, scheduled, sent, cancelled |

## Työnkulut

### `email_marketing_campaign`

| Toiminto | Siirtää | Kuka voi suorittaa | Hyväksyntä |
|---|---|---|---|
| `email_marketing_campaign.schedule` | state: draft → scheduled | `email_marketing.user` | ei |
| `email_marketing_campaign.send` | state: scheduled → sent | `email_marketing.manager` | kyllä |
| `email_marketing_campaign.send_now` | state: draft → sent | `email_marketing.manager` | kyllä |
| `email_marketing_campaign.unschedule` | state: scheduled → draft | `email_marketing.user` | ei |
| `email_marketing_campaign.cancel` | state: scheduled → cancelled | `email_marketing.user` | ei |

## Käyttöoikeusryhmät

Tämän sovelluksen käyttämät ryhmät:

- `email_marketing.manager`
- `email_marketing.user`

## Hyväksyntävaiheet

Vaiheet, joita agentti voi vain ehdottaa:

- `email_marketing_campaign.send`
- `email_marketing_campaign.send_now`

## Mitä agentit voivat ja eivät voi tehdä

Agentti voi lukea, hakea, luoda ja päivittää tämän sovelluksen tietueita sekä suorittaa toiminnot, jotka eivät vaadi hyväksyntää, tunnisteensa käyttöoikeusryhmien rajoissa.

Se voi vain ehdottaa näitä vaiheita, ja ihmisen on hyväksyttävä ne: `email_marketing_campaign.send`, `email_marketing_campaign.send_now`, `email_marketing_list.delete`, `email_marketing_contact.delete`, `email_marketing_campaign.delete`.

Henkilötiedot maskataan paikkamerkeiksi: `email_marketing_contact.email`, `email_marketing_contact.name`, `email_marketing_contact.consent_status`, `email_marketing_contact.consent_date`, `email_marketing_contact.consent_source`.

## Riippuvuudet

Ei ole.

## Asennus

Asenna se Customize-sovelluksesta (Marketplace) tai komentoriviltä:

```bash
obop modules install-from email_marketing
```

Vaatii tietokannan ja ylläpitäjän oikeudet.

## Tee oma

[Moduulioppaassa näytetään, miten tällaiset sovellukset kirjoitetaan](/fi/docs/reference/module-manifest/)
