GovWrenv0.10.0
GitHub

Email

GovWren can send its notices by email: a request that needs triage, a review task, a question from a reviewer, a decision, an answer about a tool someone asked for. Each person chooses whether to get them as they happen, once a day as a summary, or not at all.

Email is optional. Without it, everything that needs a person is on their Home page and under the bell, exactly as before.

Set it up#

In govwren.toml:

[server]
base_url = "https://govwren.example.org"

[mail]
host = "smtp.example.org"
port = 587
security = "starttls"
username = "govwren"
from_address = "govwren@example.org"

Put the password in the environment of the GovWren server, never in the file:

export GOVWREN_MAIL_PASSWORD='the password'

Then check and restart:

uv run govwren doctor
uv run govwren mail test you@example.org

doctor connects to the mail server and signs in, and sends nothing. mail test sends one message to the address of an existing account and says whether the server accepted it. An administrator can do the same from Admin → Email, which also shows how many messages are waiting, sent, and given up on, and the most recent problem.

Set base_url. Without it, messages cannot link back to GovWren, and doctor says so.

Settings#

Key in [mail]DefaultMeaning
host""The mail server. Empty sends no email
port587Its port
security"starttls""starttls" for port 587, "tls" for port 465, or "none" for a relay on this machine or a trusted network
username""The name to sign in with. Empty if the server needs none
password_env"GOVWREN_MAIL_PASSWORD"The name of the environment variable that holds the password
from_address""The address email comes from
from_name""The name shown beside it. The product's name if empty
digest_hour7The hour, in UTC, after which daily summaries are put together

host and from_address go together: set both, or neither.

What people receive#

Each person chooses under Your account → Email:

ChoiceThey receive
As things happenOne message for each notice, within about a minute
Once a day, as a summaryOne message a day listing what arrived since the last, leaving out anything they have already read in the app
NeverNothing. Home and the bell still show everything

New accounts start with As things happen.

A message says what happened in one line and links to the place in GovWren where it can be dealt with. It carries your product name and organization name. It never carries the content of a request, a reviewer's notes, or a file: to read those, the person signs in.

Your account: details, the email choice, and passwordYour account: details, the email choice, and password
Your account

How sending works#

Nothing is sent straight from the click that caused it. A notice is written to the database with the change that caused it. The mailer, which runs inside the server, picks notices up, writes each message to an outbox in the same database, and sends from there. So:

If you prefer to send from a scheduled job, or the server is not running, send what is waiting with:

uv run govwren mail run

It exits with 1 if anything could not be sent.

Notices from before email was set up are not sent when you turn it on.

When email does not arrive#

What you seeWhat to check
doctor says the mail server cannot be usedThe host, port, and security setting; that the server process can reach it; the user name and the password in the environment
Admin → Email shows messages waiting and a recent problemThe problem is the mail server's own words. A refusal that mentions the sender means from_address is not one the server will send for
A test message is accepted and never arrivesThe receiving side. Look in spam, and check that your domain's sender records allow this mail server to send for from_address
Messages arrive with no linksbase_url under [server] is empty
Describes GovWren 0.10.0. Apache License 2.0. Screenshots show an invented organization; every person and record in them is fictional.