Compare commits
3 commits
e1700c42b0
...
3b643ccd64
Author | SHA1 | Date | |
---|---|---|---|
Simon Vieille | 3b643ccd64 | ||
Simon Vieille | 0c342094b6 | ||
Simon Vieille | f53ebebeb2 |
9
DOCS.md
9
DOCS.md
|
@ -12,7 +12,7 @@ url: https://gitnet.fr/deblan/woodpecker-email
|
|||
## Settings
|
||||
|
||||
| Settings Name | Required | Type | Description | Documentation |
|
||||
| --- | --- | --- | --- | --- |
|
||||
| --------------- | -------- | ------------------ | ------------------------------------------------------------------- | ---------------------------------------------------------------------------------- |
|
||||
| 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 | |
|
||||
| from.name | no | `string` | Name of the sender | |
|
||||
|
@ -23,11 +23,8 @@ url: https://gitnet.fr/deblan/woodpecker-email
|
|||
| attachments | no | `string` or `list` | List of files to attach | YAML list or comma separated list |
|
||||
| debug | no | `boolean` | Debug mode (email are sent!) | |
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
|
||||
|
||||
```
|
||||
steps:
|
||||
mail:
|
||||
|
@ -52,14 +49,12 @@ steps:
|
|||
- log/*
|
||||
```
|
||||
|
||||
|
||||
### Evaluation and content
|
||||
|
||||
See the [Twig documentation](https://twig.symfony.com/doc/3.x/).
|
||||
|
||||
|
||||
| Variable | Value |
|
||||
| --- | --- |
|
||||
| ----------------------------- | -------------------------------- |
|
||||
| `workspace` | `CI_WORKSPACE` |
|
||||
| `repo.full_name` | `CI_REPO` |
|
||||
| `repo.owner` | `CI_REPO_OWNER` |
|
||||
|
|
|
@ -9,6 +9,7 @@ use Plugin\Loader\EnvVarLoader;
|
|||
use Plugin\Pipeline\Evaluation;
|
||||
use Symfony\Component\Mailer\Exception\TransportException;
|
||||
use Twig\Error\SyntaxError;
|
||||
use Symfony\Component\Mime\Exception\RfcComplianceException;
|
||||
|
||||
$build = EnvVarLoader::buildArray([
|
||||
'workspace' => 'CI_WORKSPACE',
|
||||
|
@ -143,6 +144,8 @@ try {
|
|||
handleError('Syntax error', $e);
|
||||
} catch (TransportException $e) {
|
||||
handleError('Transport error', $e);
|
||||
} catch (RfcComplianceException $e) {
|
||||
handleError('RFC compliance error', $e);
|
||||
} catch (\Exception $e) {
|
||||
handleError('Generic error', $e);
|
||||
}
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
namespace Plugin\Factory;
|
||||
|
||||
use Twig\Environment;
|
||||
use Twig\Loader\FilesystemLoader;
|
||||
use Twig\Extension\StringLoaderExtension;
|
||||
use Twig\Extension\DebugExtension;
|
||||
use Twig\Extension\StringLoaderExtension;
|
||||
use Twig\Loader\FilesystemLoader;
|
||||
|
||||
class TwigFactory
|
||||
{
|
||||
|
|
|
@ -12,7 +12,7 @@ function loadEnVars(array $map, array $defaults = [])
|
|||
} else {
|
||||
$data = getenv($value);
|
||||
|
||||
if ($data === false) {
|
||||
if (false === $data) {
|
||||
$data = $defaults[$value] ?? null;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue