Skip to content

Commit e1c361c

Browse files
committed
fix(email): attachments as file objects / multi-steps form
1 parent 1994379 commit e1c361c

File tree

4 files changed

+38
-35
lines changed

4 files changed

+38
-35
lines changed

classes/Actions/EmailAction.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,8 @@ public function run(): void
228228
if (is_array($attachment)) {
229229
$mailer->addAttachment($attachment['path'], $attachment['name']);
230230
} else {
231-
$mailer->addAttachment($attachment);
231+
// handle kirby file objects
232+
$mailer->addAttachment($attachment->root(), $attachment->filename());
232233
}
233234
}
234235

@@ -266,7 +267,7 @@ protected function attachments(): array
266267
$attachments[] = $file;
267268
}
268269
} else { // is PHP file object
269-
$files = array_values(A::filter($value->value(), fn($file) => $file['error'] === UPLOAD_ERR_OK));
270+
$files = array_values(A::filter($value->value(), fn ($file) => $file['error'] === UPLOAD_ERR_OK));
270271
foreach ($files as $file) {
271272
$attachments[] = [
272273
'path' => $file['tmp_name'],

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"type": "kirby-plugin",
55
"license": "proprietary",
66
"homepage": "https://plugins.andkindness.com/dreamform",
7-
"version": "2.0.2",
7+
"version": "2.0.3",
88
"authors": [
99
{
1010
"name": "Tobias Möritz",

composer.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/composer/installed.php

Lines changed: 33 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,34 @@
1-
<?php return array(
2-
'root' => array(
3-
'name' => 'tobimori/kirby-dreamform',
4-
'pretty_version' => '2.0.2',
5-
'version' => '2.0.2.0',
6-
'reference' => null,
7-
'type' => 'kirby-plugin',
8-
'install_path' => __DIR__ . '/../../',
9-
'aliases' => array(),
10-
'dev' => false,
11-
),
12-
'versions' => array(
13-
'getkirby/composer-installer' => array(
14-
'pretty_version' => '1.2.1',
15-
'version' => '1.2.1.0',
16-
'reference' => 'c98ece30bfba45be7ce457e1102d1b169d922f3d',
17-
'type' => 'composer-plugin',
18-
'install_path' => __DIR__ . '/../getkirby/composer-installer',
19-
'aliases' => array(),
20-
'dev_requirement' => false,
21-
),
22-
'tobimori/kirby-dreamform' => array(
23-
'pretty_version' => '2.0.2',
24-
'version' => '2.0.2.0',
25-
'reference' => null,
26-
'type' => 'kirby-plugin',
27-
'install_path' => __DIR__ . '/../../',
28-
'aliases' => array(),
29-
'dev_requirement' => false,
30-
),
31-
),
1+
<?php
2+
3+
return array(
4+
'root' => array(
5+
'name' => 'tobimori/kirby-dreamform',
6+
'pretty_version' => '2.0.3',
7+
'version' => '2.0.3.0',
8+
'reference' => null,
9+
'type' => 'kirby-plugin',
10+
'install_path' => __DIR__ . '/../../',
11+
'aliases' => array(),
12+
'dev' => false,
13+
),
14+
'versions' => array(
15+
'getkirby/composer-installer' => array(
16+
'pretty_version' => '1.2.1',
17+
'version' => '1.2.1.0',
18+
'reference' => 'c98ece30bfba45be7ce457e1102d1b169d922f3d',
19+
'type' => 'composer-plugin',
20+
'install_path' => __DIR__ . '/../getkirby/composer-installer',
21+
'aliases' => array(),
22+
'dev_requirement' => false,
23+
),
24+
'tobimori/kirby-dreamform' => array(
25+
'pretty_version' => '2.0.3',
26+
'version' => '2.0.3.0',
27+
'reference' => null,
28+
'type' => 'kirby-plugin',
29+
'install_path' => __DIR__ . '/../../',
30+
'aliases' => array(),
31+
'dev_requirement' => false,
32+
),
33+
),
3234
);

0 commit comments

Comments
 (0)