Issue #1310💬 AnsweredOpened July 24, 2018by dazakorn0 reactions

Grape JS works for newsletter

快速解答by AnkitKachhadiya

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, You can also get embedded CSS content using following command : var html...

Read full answer below ↓

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?

代码片段TEXT
For example:

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

and not

.style_text {
color: # FF0000;
}

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

Thank you.

Answers (3)

AnkitKachhadiyaJuly 24, 2018

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, 2018

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

代码片段TEXT
> 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, 2019

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...

Free option

Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.

Browse free plugins →
Premium option

Premium plugins ship with support, regular updates, and production-ready features — save days of integration work.

Browse premium plugins →

Related tutorials

In-depth guides on the same topic.

All tutorials →

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.