class EmailLogo
The logo shown at the top of HTML emails.
The forum logo is stored as WebP, which many mail clients (Outlook on Windows among them) can't display. Emails therefore use a PNG (or, for an animated logo, GIF) image instead: an email logo the admin uploaded, or a copy made automatically whenever the forum logo is uploaded. Each image's pixel size is stored alongside its path, so the email can carry explicit width and height attributes — Outlook ignores CSS sizing — without reading the file from the assets disk every time a message is sent.
Constants
| DISPLAY_HEIGHT |
The height, in CSS pixels, the logo is shown at in emails. |
| MAX_DISPLAY_WIDTH |
The widest the logo is shown, in CSS pixels: the 600px email body less its padding. |
| SCALE |
Images are stored at twice their display size so they stay sharp on HiDPI screens. |
| PATH_KEY |
|
| SIZE_KEY |
|
| COPY_PATH_KEY |
|
| COPY_SIZE_KEY |
|
Properties
| protected Cloud | $assetsDir |
|
Methods
No description
Scale an image down to the stored email size and encode it in a format mail clients can display. Never enlarges the image.
Store an email-safe copy of a newly uploaded forum logo, replacing any previous copy.
The size, in CSS pixels, to show an image of the given stored size at.
Details
at
line 50
__construct( SettingsRepositoryInterface $settings, ImageManager $imageManager, Factory $filesystemFactory)
at
line 64
array
encode( ImageInterface $image)
Scale an image down to the stored email size and encode it in a format mail clients can display. Never enlarges the image.
at
line 83
void
storeCopy(string $sourcePath)
Store an email-safe copy of a newly uploaded forum logo, replacing any previous copy.
at
line 97
void
deleteCopy()
at
line 105
protected void
deleteCopyFile()
at
line 124
array|null
resolve()
The logo to show in emails, if there is one a mail client can display.
In order: the uploaded email logo; the copy of the forum logo; the forum logo itself, but only if it isn't WebP (logos uploaded before they were converted to WebP are PNG, JPEG or GIF). The width and height are null when the image's size isn't known.
at
line 146
protected array
displaySize(string|null $storedSize)
The size, in CSS pixels, to show an image of the given stored size at.