About the Inline Styler category

A place for questions and discussion about Inline Styler.

Inline Styler makes CSS compatible with email clients.

Try it here: https://inlinestyler.visigo.com

It’s a service which, when given a block of HTML including CSS, will parse the CSS and convert it to inline style="" attributes on each elements matched by the CSS rules found.

The benefit of this is primarily in developing HTML emails. The most common email clients have patchy support for <style> or <link> elements, but do on the whole support a varied set of CSS properties. Its therefore necessary to instead define styles in “style” attributes on each of the elements themselves, which is tedious for anything but the simplest of emails and introduces significant code maintenance problems. The Inline Styler frees up the developer to write CSS in less tedious/more maintainable ways: using proper selectors and rules, grouped in either a stylesheet or a <style> block. The Inline Styler converts these rules into the inline “style” attributes for you.

Additionally, among the email clients who do support CSS, support for individual CSS properties is variable. The Inline Styler will analyse your CSS and estimate a compatibility rating across all the email clients as a whole, alerting you to any particular properties likely to reduce compatibility.

Hey Chris! Just tweeted you as well. I’m working on setting up a scenario in Integromat using your CSS Inliner API and am running into some snags. Should I be passing along the variables in the Header or in the Body of the request?

I’ve attached a screenshot of Integromat’s HTTP request module showing how this is set up on their end. I’ve tried almost everything I can think of. When I pass the HTML in the header variables, it errors with a invalid character response. And when I try passing it in the body (either as raw html or a JSON), it passes back the HTML of the site.

I’ve tried the “returnraw” variable in the header and JSON body as well and I’m just not getting it to work.

Any suggestions?

Trying via Postman, too…and no luck :pleading_face:

It needs to be POSTed to the endpoint, with the parameters in the body, as a FORM post, not JSON.

Here’s some c# code I use to convert templates:

        using (var client = new HttpClient())
        {
            var content = new FormUrlEncodedContent(new[]
            {
                 new KeyValuePair<string, string>("returnraw", "true"),
                 new KeyValuePair<string, string>("source", newHtml)
             });

            var result = AsyncHelper.RunSync(() => client.PostAsync(Settings.InlineStylerUrl, content));
            string resultHtml = AsyncHelper.RunSync(() => result.Content.ReadAsStringAsync());
            html = HttpUtility.HtmlDecode(resultHtml);
        }

        return html;

Hey there, I am using this api in react, and successfully getting response in networks as raw format, but i am not able to access that raw html in console log and i am not able to store that raw html in any variable, so can you please tell me how can i do that?

fetch("https://inlinestyler.visigo.com/styler/convert/", {
  mode: 'no-cors',
  method: "POST",
  body: formData
}).then((dataStr) => {
        console.log(dataStr);
      })
    .catch(error => {
      console.log(error);
    });

Maybe try some of the suggestions here:

1 Like

Thank you sooooo much, My Issue got resolved.