Repository navigation
IBX-12216: Restyled email templates to the Cohesivo email design - #2189
Conversation
| {% if icon_path is not null %} | ||
| <td width="28" style="width: 28px; padding: 0; vertical-align: middle; font-size: 0; line-height: 0;"> | ||
| <img | ||
| class="ibexa-email-icon--light" |
There was a problem hiding this comment.
BEM modifier without the block class, here and for '--dark'
| class="ibexa-email-icon--light" | |
| class="ibexa-email-icon ibexa-email-icon--light" |
| ; | ||
| $context = [ | ||
| 'hash_key' => $this->token, | ||
| 'user' => $this->user, |
There was a problem hiding this comment.
Passing the whole User puts it into the serialized email context. With SendEmailMessage routed to an async transport, the full user, passwordHash included, ends up in the queue. The template only needs the name, so how about 'user_name' => $this->user->getName()?
| {{ 'mail.footer.support'|trans|desc('Need help? We’re here for you.') }} | ||
| <a | ||
| class="ibexa-email-footer" | ||
| href="mailto:support@ibexa.co" |
There was a problem hiding this comment.
A hardcoded support@ibexa.co in the base template means every mail sends on-prem customers' users to Ibexa support. Could this be a SiteAccess-aware setting, with the support line rendered only when it's set?
There was a problem hiding this comment.
Done in 5d5bcc1: new SiteAccess setting ibexa.system.<scope>.mail.support_email, resolved in the notification's SiteAccess and rendered only when set. I kept support@ibexa.co as the default because the product decision for this ticket is to ship the footer exactly as in Figma; on-prem projects override it or hide the line with support_email: ~.
| /** | ||
| * @internal | ||
| */ | ||
| trait EmbedsMailImagesTrait |
There was a problem hiding this comment.
The trait silently relies on the host's $this->kernel and $this->logger. A small MailImageEmbedder service injected into both notifications would make that explicit and testable, and ibexa/share, which copies the same header-embedding block, could reuse it later.
| 'image_path' => '@IbexaAdminUiBundle/Resources/public/img/mail/header.png', | ||
| ]); | ||
| } | ||
| $context = $this->embedMailImages($email) + $context; |
There was a problem hiding this comment.
No tests cover asEmailMessage(): the context keys, DateInterval from config, and skipping a missing image. Could you add a couple?
| {% elseif seconds >= 3600 and seconds is divisible by(3600) %} | ||
| {% set duration = 'mail.link_expiration.hours'|trans({ '%count%': seconds // 3600 })|desc('{1}1 hour|]1,Inf[%count% hours') %} | ||
| {% else %} | ||
| {% set duration = 'mail.link_expiration.minutes'|trans({ '%count%': max(1, (seconds / 60)|round(0, 'ceil')) })|desc('{1}1 minute|]1,Inf[%count% minutes') %} |
There was a problem hiding this comment.
Could we add a test for the duration logic in this component? The days, hours and minutes branches depend on is divisible by, the >= thresholds and max(1, ... |round(0, 'ceil')). A data provider with boundary values would pin them. For example PT24H gives 1 day, PT36H gives 36 hours, PT90M gives 90 minutes, PT61S gives 2 minutes. The current tests requested in the other thread cover only the config DateInterval.
d09ea22 to
567fefb
Compare
567fefb to
30e3b4b
Compare
76bd0a7 to
f476fd0
Compare
barbaragr
left a comment
There was a problem hiding this comment.
- Gmail link color is blue instead of purple
- Outlook dark mode: white clock icon
|
Both fixed, thanks:
Which Outlook did you test in? Classic Outlook for Windows and the Gmail mobile apps darken the mail without honouring any dark-mode CSS, so there the purple clock sits on a dark background and is faint. That is expected for them: the icon is decorative and the text next to it carries the information. Apple Mail, Outlook.com and new Outlook show the light-purple icon. |
Outlook in web browser on Mac, dark mode. |
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
…ding style Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
- Replaced EmbedsMailImagesTrait with the MailImageEmbedder service - Passed user_name instead of the User object to the password reset email - Added the mail.support_email SiteAccess setting (default support@ibexa.co, null hides the line) - Added the block class to the expiration icon modifiers - Covered the notifications, the embedder, the parser and the mail templates with tests Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
…well Co-Authored-By: Claude <noreply@anthropic.com>
…ts colour Co-Authored-By: Claude <noreply@anthropic.com>
…ok dark mode too Co-Authored-By: Claude <noreply@anthropic.com>
f2dbeeb to
c2e3511
Compare
…rand colour Co-Authored-By: Claude <noreply@anthropic.com>
|
|
Done: when the greeting name is an email address (guest collaborators in share, users named by their address), it is now printed as a Commits: admin-ui dab5ce5c0 (shared |



Related PRs:
Description:
New Cohesivo email layout per Figma: header as a single PNG, title inside the card, Arial only, solid button, footer with "Contact support" and copyright, and a dark variant (Apple Mail via
prefers-color-scheme; Outlook.com and the new Outlook via their[data-ogsc]hook; Outlook for Windows applies its own colours). The clock icons have a transparent background, so a client that darkens the mail on its own shows no white box around them. Email-safe markup only: tables, inline styles,bgcolor; Outlook for Windows shows square corners.base_mail_template.html.twigkeeps every existing block (overrides keep working). New blocks:mail_title(defaults to the subject),mail_action_fallback("Open in browser" link),mail_page_footer.mail_footernow also renders the link expiry note.UserPasswordReset/UserInvitationnotifications embed the header and the light/dark clock icons through the newMailImageEmbedderservice and passlink_expiration(fromsecurity.token_interval_spec/user_invitation.hash_expiration_time). Password reset also passesuser_namefor the "Hello ," greeting.ibexa.system.<scope>.mail.support_email(defaultsupport@ibexa.co); set it to~to hide the line. The notifications resolve it in the email's SiteAccess and pass it assupport_email; the template falls back to the current SiteAccess (share emails). The footer can still be replaced by overridingmail_page_footer_content(or onlymail_page_footer_support).ibexa_mail.components/greeting_name.html.twigprints it as a purplemailto:link, so Gmail does not auto-link it in blue.components/action_btn.html.twigis a bulletproof button (table cell withbgcolorfor Outlook); the colour of the cell and the link comes from the newbg_colorinclude parameter (default#4e24a5),stylestill applies to the link only.Notifier\PasswordReset,Notifier\UserInvitationand theirNotification\*classes takeMailImageEmbedderinstead ofKernelInterface(the notifiers keepLoggerAwareInterface; the notifications no longer take a logger). Nothing in the product constructs them directly; the unit tests were adapted.For QA:
Emails are visible in the Symfony profiler (Mailer panel) even with
MAILER_DSN=null://null; to see them in a real inbox use e.g. Mailtrap.config/packages/ibexa_admin_ui.yaml:php bin/console cache:clearand repeat step 1: "Contact support" now opens a mail to helpdesk@example.com. Withsupport_email: ~the "Need help?" line disappears and only the copyright stays. Remove the block afterwards.Documentation:
Customised email templates extending
@ibexadesign/ui/mail/base_mail_template.html.twigkeep working; new optional blocks:mail_title_content,mail_action_fallback_content,mail_expiration_content,mail_page_footer_content,mail_page_footer_support.New SiteAccess-aware setting
ibexa.system.<scope>.mail.support_email(defaultsupport@ibexa.co,~hides the "Contact support" line).Template context: the password-reset email receives
user_name; the password-reset and invitation emails receivesupport_email(other emails fall back to the current SiteAccess setting).