-
Notifications
You must be signed in to change notification settings - Fork 396
Default-HTML-Frame for Mail in System Style (3/3) #9566
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: trunk
Are you sure you want to change the base?
Default-HTML-Frame for Mail in System Style (3/3) #9566
Conversation
bb21047 to
533f850
Compare
mjansenDatabay
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @kjansen2608,
I am mostly fine with these changes (which is not surprising, since I already had the opportunity to read this code internally) before this pull request.
I just left a few remarks on some minor points that I would kindly ask you (or your colleagues) to adjust.
Best regards,
Michael
| )->withLogoSrc( | ||
| 'cid:' . $this->getLogoCid($skin, $style) | ||
| )->withFooterURL( | ||
| $factory->link()->standard(ILIAS_HTTP_PATH, ILIAS_HTTP_PATH) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use ilUtil::_getHttpPath() here, since mails are also sent during cron jobs with PHP CLI, where ILIAS_HTTP_PATH cannot be determined and must be read from the "ilias.ini.php".
| foreach ($locations as $location) { | ||
| $custom_directory = $this->getPathToRootDirectory( | ||
| ) . '/public/Customizing/skin/' . $location . '/components/ILIAS/Mail/img'; | ||
| $custom_directory = $this->getPathToRootDirectory() . "/public/Customizing/skin/$location/images/logo"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we move this sub-path to a private PHP string constant (containing a placeholder for $location) to the top of the class and just replace the placeholder here?
| } | ||
|
|
||
| return file_get_contents($bracket_path); | ||
| return 'assets/css/mail.css'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we move this path to a private PHP constant to the top of the class?
| } | ||
| } | ||
| } else { | ||
| $path = $this->getPathToRootDirectory() . '/components/ILIAS/Mail/templates/default/img/ilias_logo.jpg'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we move this sub-path to a private PHP constant to the top of the class?
| foreach ($locations as $location) { | ||
| $custom_path = $this->getPathToRootDirectory( | ||
| ) . '/public/Customizing/skin/' . $location . '/components/ILIAS/Mail/tpl.html_mail_template.html'; | ||
| $custom_path = $this->getPathToRootDirectory() . "/public/Customizing/skin/$location/mail.css"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we move this sub-path to a private PHP string constant (containing a placeholder for $location) to the top of the class and just replace the placeholder here?
| protected function buildBodyMultiParts(string $skin, string $style): void | ||
| private function getPathToRootDirectory(): string | ||
| { | ||
| return realpath(dirname(__DIR__, 4) . '/'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest making this more dynamic. We could traverse up the directory tree until we find the ilias_version.php. I agree, even this is a bit fragile, but as long as the ILIAS core does not provide a central helper function for this, this is IMO the best approach.
0ddc3e1 to
8d1c6a0
Compare
8d1c6a0 to
39cf1e1
Compare
39cf1e1 to
8c843d7
Compare
adds mail component adjust docu and move css adds delos.css to mail template display logo inline changes html line-breaks adds Test for MailPage uses default header-icon instead of new .jpg fix test removes URL from template updates mail-docu and renames tpl-var fix header css design fixes Fix CS for Mail-Interface Fix CS for Mail Implementation remove unrelated fixes Fix CS for Mail test Fix CS for Renderer Fix CS change ui-mail content type from string to Content use mail.css instead off delos.css build delos.css fix tests fix docu use Dataprovider remove testGetContent removes usage of call_user_func and add commas adjust docu improve mail renderer apply all suggestions fix tests apply all suggestions use ui-mail-component for mail fix line breaks refactor mail-build adds compatibility for skins adds skin support fix method visibility Fix CS fix use of ui-mail-component use mail.css instead off delos.css refactor embedding of images apply suggestions fix use of mail.css rebase on mail-component use ComponentCSS instead of PublicAsset removes unrelated change removes unrelated changes
8c843d7 to
1a9b0bc
Compare
This PR proposes using the "Layout > Page > Mail" UI component (see #9564) for sending external emails in ILIAS.
The rendered HTML is enhanced with specific styles from the dedicated "mail.css" (see #9565).
Depends on: