|
22 | 22 | 'fields' => ['email'], |
23 | 23 | 'message' => '{field} is not a valid email address' |
24 | 24 | ], |
25 | | - 'file' => [ |
26 | | - 'fields' => ['cv_file', 'image_file'], |
27 | | - 'allowType' => ['jpeg', 'jpg', 'pdf', 'png'], |
28 | | - 'allowSize' => 10000000 //10 MB |
29 | | - ] |
30 | | - ], // acoording to Valitron doc. |
| 25 | + 'file' => [ |
| 26 | + 'fields' => ['cv_file', 'image_file'], |
| 27 | + 'allowType' => ['jpeg', 'jpg', 'pdf', 'png'], |
| 28 | + 'allowSize' => 10000000 // 10 MB |
| 29 | + ] |
| 30 | + ], // according to Valitron doc. |
31 | 31 | 'labels' => [ |
32 | 32 | 'name' => 'Name', |
33 | 33 | 'email' => 'Email address' |
34 | | - ] // acoording to Valitron doc. |
| 34 | + ] // according to Valitron doc. |
35 | 35 | ]; |
36 | 36 |
|
37 | 37 | $mailerConfig = [ |
|
44 | 44 | ]; |
45 | 45 |
|
46 | 46 | $fileManager = new FileManager([ |
47 | | - 'uploadPath' => __DIR__ . '/attachments', |
48 | | - 'uploadUrl' => $_SERVER['HTTP_ORIGIN'] . '/attachments', |
49 | | - ] |
50 | | -); |
| 47 | + 'uploadPath' => __DIR__ . '/attachments', |
| 48 | + 'uploadUrl' => $_SERVER['HTTP_ORIGIN'] . '/attachments', |
| 49 | +]); |
51 | 50 |
|
52 | 51 | $message = [ |
53 | | - 'from' => ['hello@justcoded.co.uk' => 'FROM NAME'], |
54 | | - 'to' => ['kostant21@yahoo.com' => 'TO NAME'], |
| 52 | + 'from' => ['hello@justcoded.co.uk' => 'FROM NAME'], |
| 53 | + 'to' => ['kostant21@yahoo.com' => 'TO NAME'], |
55 | 54 | // 'cc' => ['email' => 'name'], |
56 | 55 | // 'bcc' => ['email' => 'name'], |
57 | 56 | 'subject' => 'Contact request from {name}', |
58 | | - 'bodyTemplate' => __DIR__ . '/template-html.php', |
| 57 | + 'bodyTemplate' => __DIR__ . '/template-html.php', |
59 | 58 | 'altBodyTemplate' => __DIR__ . '/template-plain.php', |
60 | | - 'attachments' => $fileManager->upload([ |
61 | | - 'cv_file', 'image_file' |
62 | | - ]) |
| 59 | + 'attachments' => $fileManager->upload([ |
| 60 | + 'cv_file', 'image_file' |
| 61 | + ]) |
63 | 62 | ]; |
64 | 63 |
|
65 | 64 |
|
|
71 | 70 | } |
72 | 71 |
|
73 | 72 | echo json_encode($formHandler->response()); |
74 | | - |
0 commit comments