2023-01-15 12:12:00 +01:00
|
|
|
---
|
|
|
|
name: Woodpecker Email
|
2024-01-15 12:38:30 +01:00
|
|
|
author: Simon Vieille
|
2023-01-15 12:12:00 +01:00
|
|
|
icon: https://gitnet.fr/deblan/woodpecker-email/raw/branch/develop/logo.svg
|
|
|
|
description: plugin to send build status notifications via Email.
|
2023-01-15 12:24:42 +01:00
|
|
|
tags: [notifications, email]
|
2023-01-15 12:12:00 +01:00
|
|
|
containerImage: deblan/woodpecker-email
|
|
|
|
containerImageUrl: https://hub.docker.com/r/deblan/woodpecker-email
|
|
|
|
url: https://gitnet.fr/deblan/woodpecker-email
|
|
|
|
---
|
|
|
|
|
2024-01-15 12:38:30 +01:00
|
|
|
## Settings
|
2015-11-11 02:44:23 +01:00
|
|
|
|
2024-01-15 12:38:30 +01:00
|
|
|
| Settings Name | Required | Type | Description | Documentation |
|
2024-02-21 19:08:10 +01:00
|
|
|
| --------------- | -------- | ------------------ | ------------------------------------------------------------------- | ---------------------------------------------------------------------------------- |
|
2024-01-15 12:38:30 +01:00
|
|
|
| dsn | yes | `string` | Mail transport configuration | [Documentation](https://symfony.com/doc/current/mailer.html#tls-peer-verification) |
|
|
|
|
| from.address | yes | `string` | Email address of the sender | |
|
2024-01-15 14:38:09 +01:00
|
|
|
| from.name | no | `string` | Name of the sender | |
|
2024-01-15 12:38:30 +01:00
|
|
|
| recipients | no | `string` or `list` | List of recipients to send this mail to (besides the commit author) | YAML list or comma separated list |
|
|
|
|
| recipients_only | no | `boolean` | Exclude the committer | |
|
|
|
|
| content.subject | no | `string` | Define the email subject template | |
|
|
|
|
| content.body | no | `string` | Define the email body template | |
|
|
|
|
| attachments | no | `string` or `list` | List of files to attach | YAML list or comma separated list |
|
2024-02-19 14:24:42 +01:00
|
|
|
| debug | no | `boolean` | Debug mode (email are sent!) | |
|
2017-01-16 13:20:59 +01:00
|
|
|
|
2024-01-15 12:38:30 +01:00
|
|
|
### Example
|
2015-11-11 02:44:23 +01:00
|
|
|
|
2017-01-16 13:20:59 +01:00
|
|
|
```
|
2024-01-15 12:38:30 +01:00
|
|
|
steps:
|
2023-01-15 12:12:00 +01:00
|
|
|
mail:
|
2024-03-12 23:00:41 +01:00
|
|
|
image: deblan/woodpecker-email
|
2023-01-15 12:12:00 +01:00
|
|
|
settings:
|
2024-01-15 12:38:30 +01:00
|
|
|
dsn: "smtp://username:password@mail.example.com:587?verify_peer=1"
|
|
|
|
from:
|
|
|
|
address: "woodpecker@example.com"
|
|
|
|
name: "Woodpecker"
|
|
|
|
evaluate: "build.status == 'failure' or prev_pipeline.status == 'failure'"
|
|
|
|
recipients:
|
|
|
|
- dev1@example.com
|
|
|
|
- dev2@example.com
|
|
|
|
recipients_only: false
|
|
|
|
content:
|
|
|
|
subject: "[{{ pipeline.status }}] {{ repo.full_name }} ({{ commit.branch }} - {{ commit.sha[0:8] }}"
|
|
|
|
body: |
|
|
|
|
{{ commit.sha }}<br>
|
|
|
|
{{ pipeline.status }}<br>
|
|
|
|
{{ commit.author_email }}<br>
|
|
|
|
attachments:
|
|
|
|
- log/*
|
2015-12-16 11:41:30 +01:00
|
|
|
```
|
2021-10-29 22:27:55 +02:00
|
|
|
|
2024-01-15 12:38:30 +01:00
|
|
|
### Evaluation and content
|
|
|
|
|
|
|
|
See the [Twig documentation](https://twig.symfony.com/doc/3.x/).
|
|
|
|
|
|
|
|
| Variable | Value |
|
2024-02-21 19:08:10 +01:00
|
|
|
| ----------------------------- | -------------------------------- |
|
2024-01-15 12:38:30 +01:00
|
|
|
| `workspace` | `CI_WORKSPACE` |
|
|
|
|
| `repo.full_name` | `CI_REPO` |
|
|
|
|
| `repo.owner` | `CI_REPO_OWNER` |
|
|
|
|
| `repo.name` | `CI_REPO_NAME` |
|
|
|
|
| `repo.url` | `CI_REPO_URL` |
|
|
|
|
| `commit.sha` | `CI_COMMIT_SHA` |
|
|
|
|
| `commit.ref` | `CI_COMMIT_REF` |
|
|
|
|
| `commit.branch` | `CI_COMMIT_BRANCH` |
|
|
|
|
| `commit.source_branch` | `CI_COMMIT_SOURCE_BRANCH` |
|
|
|
|
| `commit.target_branch` | `CI_COMMIT_TARGET_BRANCH` |
|
|
|
|
| `commit.tag` | `CI_COMMIT_TAG` |
|
|
|
|
| `commit.pull_request` | `CI_COMMIT_PULL_REQUEST` |
|
|
|
|
| `commit.pull_request_labels` | `CI_COMMIT_PULL_REQUEST_LABELS` |
|
|
|
|
| `commit.message` | `CI_COMMIT_MESSAGE` |
|
|
|
|
| `commit.author` | `CI_COMMIT_AUTHOR` |
|
|
|
|
| `commit.author_email` | `CI_COMMIT_AUTHOR_EMAIL` |
|
|
|
|
| `commit.author_avatar` | `CI_COMMIT_AUTHOR_AVATAR` |
|
2024-02-03 00:18:09 +01:00
|
|
|
| `commit.prerelease` | `CI_COMMIT_PRERELEASE` |
|
2024-01-15 12:38:30 +01:00
|
|
|
| `prev_commit.sha` | `CI_PREV_COMMIT_SHA` |
|
|
|
|
| `prev_commit.ref` | `CI_PREV_COMMIT_REF` |
|
|
|
|
| `prev_commit.branch` | `CI_PREV_COMMIT_BRANCH` |
|
|
|
|
| `prev_commit.source_branch` | `CI_PREV_COMMIT_SOURCE_BRANCH` |
|
|
|
|
| `prev_commit.target_branch` | `CI_PREV_COMMIT_TARGET_BRANCH` |
|
|
|
|
| `prev_commit.message` | `CI_PREV_COMMIT_MESSAGE` |
|
|
|
|
| `prev_commit.author` | `CI_PREV_COMMIT_AUTHOR` |
|
|
|
|
| `prev_commit.author_email` | `CI_PREV_COMMIT_AUTHOR_EMAIL` |
|
|
|
|
| `prev_commit.author_avatar` | `CI_PREV_COMMIT_AUTHOR_AVATAR` |
|
|
|
|
| `prev_commit.url` | `CI_PREV_COMMIT_URL` |
|
|
|
|
| `pipeline.number` | `CI_PIPELINE_NUMBER` |
|
|
|
|
| `pipeline.parent` | `CI_PIPELINE_PARENT` |
|
|
|
|
| `pipeline.event` | `CI_PIPELINE_EVENT` |
|
|
|
|
| `pipeline.url` | `CI_PIPELINE_URL` |
|
|
|
|
| `pipeline.deploy_target` | `CI_PIPELINE_DEPLOY_TARGET` |
|
|
|
|
| `pipeline.status` | `CI_PIPELINE_STATUS` |
|
|
|
|
| `pipeline.created_at` | `CI_PIPELINE_CREATED` |
|
|
|
|
| `pipeline.stared_at` | `CI_PIPELINE_STARTED` |
|
|
|
|
| `pipeline.finished_at` | `CI_PIPELINE_FINISHED` |
|
|
|
|
| `prev_pipeline.number` | `CI_PREV_PIPELINE_NUMBER` |
|
|
|
|
| `prev_pipeline.parent` | `CI_PREV_PIPELINE_PARENT` |
|
|
|
|
| `prev_pipeline.event` | `CI_PREV_PIPELINE_EVENT` |
|
|
|
|
| `prev_pipeline.url` | `CI_PREV_PIPELINE_URL` |
|
|
|
|
| `prev_pipeline.deploy_target` | `CI_PREV_PIPELINE_DEPLOY_TARGET` |
|
|
|
|
| `prev_pipeline.status` | `CI_PREV_PIPELINE_STATUS` |
|
|
|
|
| `prev_pipeline.created_at` | `CI_PREV_PIPELINE_CREATED` |
|
|
|
|
| `prev_pipeline.stared_at` | `CI_PREV_PIPELINE_STARTED` |
|
|
|
|
| `prev_pipeline.finished_at` | `CI_PREV_PIPELINE_FINISHED` |
|
|
|
|
| `workflow.name` | `WORKFLOW_NAME` |
|
|
|
|
| `step.name` | `CI_STEP_NAME` |
|
|
|
|
| `step.number` | `CI_STEP_NUMBER` |
|
|
|
|
| `step.status` | `CI_STEP_STATUS` |
|
|
|
|
| `step.start_at` | `CI_STEP_STARTED` |
|
|
|
|
| `step.finished_at` | `CI_STEP_FINISHED` |
|
|
|
|
| `step.url` | `CI_STEP_URL` |
|
|
|
|
|
|
|
|
[dsn_doc]: https://symfony.com/doc/current/mailer.html#tls-peer-verification
|