add setting "debug"
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
parent
84a6fa518f
commit
a291a03d89
1
DOCS.md
1
DOCS.md
|
@ -21,6 +21,7 @@ url: https://gitnet.fr/deblan/woodpecker-email
|
||||||
| content.subject | no | `string` | Define the email subject template | |
|
| content.subject | no | `string` | Define the email subject template | |
|
||||||
| content.body | no | `string` | Define the email body 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 |
|
| attachments | no | `string` or `list` | List of files to attach | YAML list or comma separated list |
|
||||||
|
| debug | no | `boolean` | Debug mode (email are sent!) | |
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
14
bin/console
14
bin/console
|
@ -89,8 +89,10 @@ $config = EnvVarLoader::buildArray([
|
||||||
'attachments' => 'PLUGIN_ATTACHMENTS',
|
'attachments' => 'PLUGIN_ATTACHMENTS',
|
||||||
'evaluate' => 'PLUGIN_EVALUATE',
|
'evaluate' => 'PLUGIN_EVALUATE',
|
||||||
'content' => 'PLUGIN_CONTENT',
|
'content' => 'PLUGIN_CONTENT',
|
||||||
|
'is_debug' => 'PLUGIN_DEBUG',
|
||||||
], [
|
], [
|
||||||
'PLUGIN_RECIPIENTS_ONLY' => true,
|
'PLUGIN_RECIPIENTS_ONLY' => true,
|
||||||
|
'PLUGIN_DEBUG' => false,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
function writeln(...$values)
|
function writeln(...$values)
|
||||||
|
@ -110,6 +112,18 @@ function handleError($section, Exception $e)
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($config['is_debug']) {
|
||||||
|
writeln(
|
||||||
|
'Debug',
|
||||||
|
'=====',
|
||||||
|
'Config',
|
||||||
|
json_encode($config, JSON_PRETTY_PRINT),
|
||||||
|
'Environment',
|
||||||
|
json_encode($_SERVER, JSON_PRETTY_PRINT),
|
||||||
|
'====='
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
$twig = (new TwigFactory())->create();
|
$twig = (new TwigFactory())->create();
|
||||||
$emailFactory = new EmailFactory($twig, $config, $build);
|
$emailFactory = new EmailFactory($twig, $config, $build);
|
||||||
$evaluation = new Evaluation($twig);
|
$evaluation = new Evaluation($twig);
|
||||||
|
|
Loading…
Reference in a new issue