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

Email Layout design - Limit width #265

Open
Kettoch opened this issue Aug 18, 2021 · 2 comments
Open

Email Layout design - Limit width #265

Kettoch opened this issue Aug 18, 2021 · 2 comments
Labels
bug Something isn't working enhancement New feature or request

Comments

@Kettoch
Copy link

Kettoch commented Aug 18, 2021

I am looking to create our emails using the organizational standard of 800px as the width.

The idea being that once set, it sets the width for all content below the point at which it was set.
This could help in multi column email layouts, too.

@danubie
Copy link

danubie commented Aug 26, 2021

Hi @Kettoch,
I was tinkering with a similar topic on table sizes a few days ago.
Przemysławs module does an excellent job for creating cool HTML output. Producing HTML-Emails has some limits due to the limited CSS-support of email-clients. Some of the features, which work very well in HTML-pages, can't be used in Emails.

But I also have to mention: My experience is, that the native Outlook-Client does a funny job in rendering HTML-emails.
The following samples work fine when viewed as HTML-Page, on IPhone Outlook- and native-App but Windows-Outlook-Client seems to ignore some CSS-styles.

In general: To change the visual behaviour you have to modify CSS-styles depending on your need.

I hope the following examples will help you to start that journey.
Regards,
Wolfgang

Example 1:
To limit the overall size of the whole document you could try this

$CssTotallySmall = '.main-section { width: 200px; }'
EmailBody {
            Add-HTMLStyle -Content $CssTotallySmall -SkipTags
...
}

Example 2:
Tables seem to be handled better even in windows-client.
The following should limit all tables to max 800px.

$CssTable = 'table.display.compact { max-width: 800px }'
EmailBody {
            Add-HTMLStyle -Content $CssTable -SkipTags
...
}

Remark: If you use Email-Table -Style ... you have to use different table css-selectors.

@PrzemyslawKlys
Copy link
Member

The trick to email in outlook is to stop using px and just use numbers alone. It works like that for images, it most likely works like that for tables (inline). I need to improve EmailLayout cmdlet with more options to basically allow to create multi-column layout, or layout that you often get with marketing emails.

I just need some time to do so - or help from you guys :)

@PrzemyslawKlys PrzemyslawKlys added bug Something isn't working enhancement New feature or request labels Sep 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants