Skip to content

Commit

Permalink
Add test case
Browse files Browse the repository at this point in the history
  • Loading branch information
dereuromark committed Mar 10, 2023
1 parent 98ec845 commit 4b17f9b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
13 changes: 13 additions & 0 deletions docs/sections/tasks/email.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,25 @@ For some like to/cc you can even define multiple emails:
```
Note that this needs an additional array nesting in this case.

You can add helpers using `helper` (single) or `helpers` (multiple) keys inside settings:
```php
$data = [
'settings' => [
...
'helpers' => [['Shim.Configure']],
],
...
];
```

You can also assemble a Mailer object manually and pass that along as settings directly:
```php
$data = [
'settings' => $mailerObject,
'content' => $content,
];
```
Deprecated: This is not recommended as it breaks as soon as the code changes.

Or send reusable Emails via the Mailer object:
```php
Expand All @@ -62,6 +74,7 @@ $data = [
'vars' => [$var1, $var2, $var3]
];
```
Deprecated: This is not recommended as it breaks as soon as the code changes.

Inside a controller you can for example do this for your mailers:
```php
Expand Down
1 change: 1 addition & 0 deletions tests/TestCase/Queue/Task/EmailTaskTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ public function testRunArrayEmailComplex() {
'copy-other@test.de' => 'Your Other Name',
],
],
'helpers' => [['Shim.Configure']],
];

$data = [
Expand Down

0 comments on commit 4b17f9b

Please sign in to comment.