Skip to content
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

Error : importing external CSS styles #388

Closed
maximovj opened this issue Nov 16, 2024 · 6 comments
Closed

Error : importing external CSS styles #388

maximovj opened this issue Nov 16, 2024 · 6 comments
Labels
bug Something isn't working

Comments

@maximovj
Copy link

Error : importing external CSS styles

I am working with HTML and Bootstrap v5 to send an email and display Bootstrap v5 CSS styles, but mailpit cannot load the Bootstrap styles correctly. The same issue occurs with emails sent from Laravel.

In the HTML Source tab, I can see the code in more detail, but in the HTML tab, the Bootstrap 5 styles are not applied correctly. I have tried adding the --block-remote-css-and-fonts flag as per the official documentation to fix the issue, but the problem persists.

This is the tab: HTML Source
image

This is the tab: HTML Source
image

This is the expected result:
image

@axllent
Copy link
Owner

axllent commented Nov 16, 2024

It should be working as-is because remote CSS is not blocked by default. Can you please attach a sample message (which I can feed into my Mailpit) to test? Thanks.

@maximovj
Copy link
Author

This is a test message I am making.
message-test.txt

I noticed that this error appears in the browser console, it could be the issue.
image

I am currently using Laravel 8.x and PHP 7.4.33 from Laragon, as shown in the image.
image

I did one last test, now in MailHog, and it works correctly when viewing the HTML.
image

@axllent
Copy link
Owner

axllent commented Nov 17, 2024

Bug confirmed - leave this with me!

@axllent axllent added the bug Something isn't working label Nov 17, 2024
@axllent
Copy link
Owner

axllent commented Nov 17, 2024

Thanks for reporting this bug - it's actually been broken for several months so I'm surprised nobody reported it earlier! The fix has been fixed in v1.21.4. Please let me know if it is working again for you? Thanks.

@maximovj
Copy link
Author

I ran two tests using version v1.21.4, and the issue was successfully resolved.
Cool, bro, it works.

This is test number one
image

This is test number two
image

@axllent
Copy link
Owner

axllent commented Nov 17, 2024

Perfect, thanks for testing and the quick confirmation!

Regarding using external stylesheets (in general), please note that external CSS files is not the recommended approach as popular web clients like Gmail do not support it. And of those that do, most do not support modern CSS like bootstrap (so some features may not work). If you're going to be using it, then keep in mind that there will be a significant portion of users who will not have any styling applied.

I'll close this issue now. Thanks again for reporting it!

@axllent axllent closed this as completed Nov 17, 2024
tmeijn pushed a commit to tmeijn/dotfiles that referenced this issue Nov 21, 2024
This MR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [axllent/mailpit](https://github.com/axllent/mailpit) | minor | `v1.20.7` -> `v1.21.4` |

MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot).

**Proposed changes to behavior should be submitted there as MRs.**

---

### Release Notes

<details>
<summary>axllent/mailpit (axllent/mailpit)</summary>

### [`v1.21.4`](https://github.com/axllent/mailpit/blob/HEAD/CHANGELOG.md#v1214)

[Compare Source](axllent/mailpit@v1.21.3...v1.21.4)

##### Bugfix

-   Fix external CSS stylesheet loading in HTML preview ([#&#8203;388](axllent/mailpit#388))

### [`v1.21.3`](https://github.com/axllent/mailpit/blob/HEAD/CHANGELOG.md#v1213)

[Compare Source](axllent/mailpit@v1.21.2...v1.21.3)

##### Chore

-   Update Go dependencies
-   Minor UI tweaks
-   Mute Dart Sass deprecation notices
-   Update node dependencies
-   Upgrade Alpine packages on Docker build
-   Add swagger examples & API code restructure

### [`v1.21.2`](https://github.com/axllent/mailpit/blob/HEAD/CHANGELOG.md#v1212)

[Compare Source](axllent/mailpit@v1.21.1...v1.21.2)

##### Feature

-   Add additional ignored flags to sendmail ([#&#8203;384](axllent/mailpit#384))

##### Chore

-   Remove legacy Tags column from message DB table
-   Update Go dependencies
-   Update node dependencies

##### Fix

-   Fix browser notification request on Edge ([#&#8203;89](axllent/mailpit#89))

### [`v1.21.1`](https://github.com/axllent/mailpit/blob/HEAD/CHANGELOG.md#v1211)

[Compare Source](axllent/mailpit@v1.21.0...v1.21.1)

##### Feature

-   Add ability to search by size smaller or larger than a value (eg: `larger:1M` / `smaller:2.5M`)
-   Add ability to search for messages containing inline images (`has:inline`)

##### Chore

-   Update Go dependencies
-   Separate attachments and inline images in download nav and badges ([#&#8203;379](axllent/mailpit#379))

### [`v1.21.0`](https://github.com/axllent/mailpit/blob/HEAD/CHANGELOG.md#v1210)

[Compare Source](axllent/mailpit@v1.20.7...v1.21.0)

##### Feature

-   Experimental Unix socket support for HTTPD & SMTPD ([#&#8203;373](axllent/mailpit#373))

##### Fix

-   Allow multiple item selection on macOS with Cmd-click  ([#&#8203;378](axllent/mailpit#378))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this MR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40NDAuNyIsInVwZGF0ZWRJblZlciI6IjM3LjQ0MC43IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJSZW5vdmF0ZSBCb3QiXX0=-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants