ILIAS  trunk Revision v12.0_alpha-377-g3641b37b9db
Mail.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
26use ILIAS\UI\Implementation\Component\ComponentHelper;
28use InvalidArgumentException;
29
30class Mail implements Page\Mail
31{
32 use ComponentHelper;
34
35 public function __construct(
36 protected string $stylesheet_path,
37 protected string $logo_url,
38 protected string $installation_title,
39 protected Content $html_content,
40 protected Link $footer_url,
41 ) {
42 if (!is_readable($this->getStyleSheetPath())) {
43 throw new InvalidArgumentException("Could not read stylesheet at {$this->getStyleSheetPath()}.");
44 }
45
46 if (!str_starts_with($this->getLogoURL(), 'cid:') && !str_starts_with($this->getLogoURL(), 'data:')) {
47 throw new InvalidArgumentException('The logo URL must be a cid or data URL.');
48 }
49 }
50
51 public function getContent(): array
52 {
53 return [
54 $this->html_content,
55 ];
56 }
57
58 public function getLogoURL(): string
59 {
60 return $this->logo_url;
61 }
62
63 public function getInstallationTitle(): string
64 {
65 return $this->installation_title;
66 }
67
68 public function getStyleSheetPath(): string
69 {
70 return $this->stylesheet_path;
71 }
72
73 public function getFooterURL(): Link
74 {
75 return $this->footer_url;
76 }
77}
__construct(protected string $stylesheet_path, protected string $logo_url, protected string $installation_title, protected Content $html_content, protected Link $footer_url,)
Definition: Mail.php:35
This describes the Mail.
Definition: Mail.php:27
trait JavaScriptBindable
Trait for components implementing JavaScriptBindable providing standard implementation.
RFC 822 Email address list validation Utility.