# Part 1 · The e-mail log and what is sent

## 1.1 Reading the e-mail log

**Who** · `Owner` `Admin` · whoever holds "Read the workspace's e-mail log"; `Service` for every workspace.

**Where** · **E-mail log** in the menu (the Service's is under the platform's pages).

**Before you start** · Nothing.

**The steps**
1. The log lists every e-mail, newest first: when, its subject and event, who it went to, and how it went. Filter by
   status (waiting, sent, partly sent, failed), by event or by date; search a subject or an address.
2. Open one with its folder icon: its people, each To, CC or BCC with how they were reached; the e-mail exactly as it
   went; what it was (event, template version, language); and what happened, try by try.

**What the record shows** · The row itself is the record: it can't be changed, only removed by the purge (1.7).

**Who is told** · Nobody.

**What can go wrong**
- *"Waiting" stays.* The queue worker isn't running: e-mails are logged at once and sent by the queue.
- *A one-time link shows as "[one-time link, not kept]".* On purpose: invitation and reset links are never stored.
- *Another workspace's e-mail says "not found".* A workspace reads only its own.

## 1.2 Resending an e-mail

**Who** · `Owner` `Admin` · "Resend an e-mail from the log"; `Service` for any.

**Where** · **E-mail log** › the e-mail › **Resend**.

**Before you start** · The e-mail can't have carried a one-time link (the page says so and offers no Resend).

**The steps**
1. Choose **To the same people**, or **To some of them** and tick who.
2. Press **Resend**. The new e-mail opens: its own row, "A resend of an earlier e-mail", with the words as they were
   then, not today's template.

**What the record shows** · The new row names the first; the first lists its resends.

**Who is told** · The people chosen.

**What can go wrong**
- *"Choose at least one of the people it went to."* Tick someone, or choose the same people.

## 1.3 Inviting someone to sign in

**Who** · `Owner` `Admin` · "Invite people to sign in".

**Where** · **People** › the person › **Signing in** › **Invite to sign in**.

**Before you start** · They are active here, have an e-mail on their record, and no account yet.

**The steps**
1. Press **Invite to sign in**. The panel says when they were invited and until when the link works (7 days as
   shipped; the Service's setting **Invitation link**).
2. They follow the link, choose a password, and are signed in to this workspace.
3. To send another, press **Send a new invitation**: the old link stops working.

**What the record shows** · The audit log: `membership.invited`, then `membership.joined` when they choose a password.
The e-mail log: the invitation, its link masked.

**Who is told** · The person invited, by `membership.invited`.

**What can go wrong**
- *The link says it no longer works.* It was used, replaced or ran out, or the e-mail on their record was changed
  after it was sent: send a new one, which goes to the address the record holds now.
- *No button.* They already sign in, have no e-mail, or are turned off.

## 1.4 Resetting your password

**Who** · Anyone with an account.

**Where** · **Sign in** › **Forgot your password?**

**Before you start** · The e-mail you sign in with.

**The steps**
1. Type it and press **Send the link**. The reply is the same whether or not the address has an account.
2. Follow the link in the e-mail (it works once, for 60 minutes), choose a new password, and sign in with it.

**What the record shows** · The sign-in log: `password_reset_completed`. The e-mail log: the reset, platform mail, its
link masked.

**Who is told** · The account's owner, by `password.reset_requested`.

**What can go wrong**
- *No e-mail arrives.* The address has no account, or it is the Service's (changed only by `service:reset`).
- *The link says it's invalid.* It was used or ran out: ask again.

## 1.5 Changing who an event e-mails (Service)

**Who** · `Service` · "Change the e-mails each event sends".

**Where** · **Notifications** › the people icon beside the event.

**Before you start** · Nothing. A line with a lock is one the app relies on, and stays.

**The steps**
1. Choose **One e-mail to everyone** (To, CC and BCC on one message) or **One e-mail each** (each person their own,
   with their name).
2. Add lines: To, CC or BCC, then who: the person the event names, everyone in the workspace who may do something
   (a permission), everyone holding a standard role, an address, or the Service.
3. Press **Save changes**. The toggle on the list switches an event's e-mail off and on (never a locked one).

**What the record shows** · The audit log: `notification_rule.changed`, `.on`, `.off`, the platform's own lines.

**Who is told** · Nobody. Who it reaches is worked out when each e-mail goes, so it follows people's roles as they are.

**What can go wrong**
- *"Choose who, from those this kind offers."* An address that isn't one, or nothing chosen.
- *The rule notes "Nobody was left to write to".* Its lines found nobody (the actor is left out by default).

## 1.6 Changing an e-mail's words (Service)

**Who** · `Service`.

**Where** · **Notifications** › the pen beside the event.

**Before you start** · The tokens it can say are listed beside the words.

**The steps**
1. Change the subject, heading, message, button or note. With more than one language on, pick the language first; an
   empty one uses the English.
2. Press **Save changes**: a new version, kept. **Send me a test** e-mails it to you with example facts, marked as a
   test in the log.
3. **Back to the shipped words** returns the release's words, your own kept as an old version.

**What the record shows** · The audit log: `notification_template.changed` with its version; each mail records the
version it used.

**Who is told** · Nobody.

**What can go wrong**
- *"Only this event's tokens work."* A token another event fills; the list beside shows this one's.
- *"English is always needed here."* The subject and the message need their English words.

## 1.7 Purging old mail (operator)

**Who** · The operator, on the server.

**Where** · `php artisan logs:purge --log=email_message --before=YYYY-MM-DD`. Since S10 the log is also purged every
night by its age (**Keep the e-mail log for**, a setting; the Logs manual).

**Before you start** · The day before which e-mails go. The newest 30 days always stay (the setting's least).

**The steps**
1. Run it without `--force`: it says how many would go, and removes nothing.
2. Run it again with `--force`: every e-mail before the day is written to
   `storage/app/private/purge/<id>/email_message-before-<day>.jsonl.gz` with its checksum, then removed.

**What the record shows** · A `log_purge` row kept for good (counts, archive, checksum) and `log.purged` in the audit
log.

**Who is told** · Nobody.

**What can go wrong**
- *"The E-mail log keeps its newest entries."* The day is inside the shortest keep.
