Issue #1310Opened July 24, 2018by dazakorn0 reactions

Grape JS works for newsletter

Question

We are testing to use the editor and we want to know if the grape js editor works for content newsletters, we were doing tests but CSS styles in HTML are added as classes and classes do not work in gmail for example.

How can I add CSS embedded in the HTML with the editor?

Code SnippetTEXT
For example:

<div style = "color: # FF0000; ......"

and not

.style_text {
color: # FF0000;
}

<div class = "style_text" ....>

Thank you.

Answers (3)

AnkitKachhadiyaJuly 24, 20180 reactions

hey @dazakorn we are also using these editor for newsletters we embedded CSS using following code you can also try these it worked for us:

Initialze your editor in following way or simply add these code during initialization : forceClass: false,

var editor = grapesjs.init({
                                clearOnRender: true,
                                container: '#gjs',
                                forceClass: false,
                                plugins: ['gjs-preset-newsletter'],
                                pluginsOpts: {
                                    'gjs-preset-newsletter': {
                                        modalTitleImport: 'Import template'
                                    }
                                }
                            });

You can also get embedded CSS content using following command : var html = editor.runCommand('gjs-get-inlined-html');

Hope It works!!!

dazakornJuly 24, 20180 reactions

Hello Ankit,

Perfect, I'll do tests with these changes, it seems that this is just what I needed, thank you very much.

2018-07-24 0:03 GMT-05:00 Ankit Kachhadiya [email protected]:

hey @dazakorn https://github.com/dazakorn we are also using these editor for newsletters we embedded CSS using following code you can also try these it worked for us:

Initialze your editor in following way or simply add these code during

Code SnippetTEXT
> initialization :
> forceClass: false,
>
> var editor = grapesjs.init({
>                                 clearOnRender: true,
>                                 container: '#gjs',
>                                 forceClass: false,
>                                 plugins: ['gjs-preset-newsletter'],
>                                 pluginsOpts: {
>                                     'gjs-preset-newsletter': {
>                                         modalTitleImport: 'Import template'
>                                     }
>                                 }
>                             });
>
> You can also get embedded CSS content using following command :
> var html = editor.runCommand('gjs-get-inlined-html');
>
> Hope It works!!!
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <https://github.com/artf/grapesjs/issues/1310#issuecomment-407282103>, or mute
> the thread
> <https://github.com/notifications/unsubscribe-auth/APvOQ3nHKbfFQ2h7vdA2HJ5f9NA1HwjQks5uJqqrgaJpZM4VbwMw>
> .
>



-- 
Luis David Males
Ing. Sistemas
Universidad del Valle
Cel: 300 3736251
lock[bot]September 17, 20190 reactions

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Related Questions and Answers

Continue research with similar issue discussions.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.