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

Minimize themes #11

Open
janekolszak opened this issue Jun 20, 2017 · 2 comments
Open

Minimize themes #11

janekolszak opened this issue Jun 20, 2017 · 2 comments

Comments

@janekolszak
Copy link

Hi!
Would you consider minimizing the html/css themes?

For example we could:

config := hermes.Config{
    // Optional Theme
    // Theme: new(Default) 
    Product: hermes.Product{
        // Appears in header & footer of e-mails
        Name: "Hermes",
        Link: "https://example-hermes.com/",
        // Optional product logo
        Logo: "http://www.duchess-france.org/wp-content/uploads/2016/01/gopher.png",
    },
}

h := hermes.New(config)
...
@matcornic
Copy link
Owner

Hello :)

Minifying would be nice indeed, and I agree that this should be an option.

In your example hermes.Config is the same struct as hermes.Hermes. We could just add a new bool member in the struct for minifying the theme. It would avoid API breaking changes.

Or another (better?) solution is to enhance GenerateHTML function (you won't minify plain text) with new parameter(s). There are solutions for this new parameter to be optional, like the option... syntax, in order to avoid breaking changes.

@janekolszak
Copy link
Author

I thought minifying should be done only once, when reading the theme. That's why it needs to be done in the New() function. Running minifier each time we send an email is an overkill.

Changing API won't be a problem - you just need to make a "major" release.

mkodrats added a commit to mkodrats/hermes that referenced this issue Apr 16, 2021
Feature  - Add text Mesralink Support Email
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants