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?
For example:
<div style = "color: # FF0000; ......"
and not
.style_text {
color: # FF0000;
}
<div class = "style_text" ....>
Thank you.Answers (3)
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!!!
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
> 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 3736251This 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.
Issue #1836
How to add !important in all the generated apis
Hello @artf, While i am going to edit some html from editor with the help of css then i need to add !important into all the css which is ch...
Issue #1733
How to remove script tag which is added by add block manager script
Hello @artf I want to export final/production based html content excluding the script(Only which is added by block manager). Suppose i am a...
Issue #1807
GrapeJs framework breaks on adding external stylesheet
When i add my external stylesheet using the grapesjs framework no more works. How can I have the style sheet as well as the grapesjs framew...
Issue #1621
Question on css classnames used in demo
In the demo page https://grapesjs.com/demo.html, I see that the elements are centered using a class called container-width.Where can I see...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.