Socket
Socket
Sign inDemoInstall

@yakoue/vue-email-builder

Package Overview
Dependencies
22
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @yakoue/vue-email-builder

#Yakoue's MJML Drag & Drop email builder component for vuejs


Version published
Weekly downloads
37
increased by27.59%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

Yakoue Email Editor

Yakoue Email builder

Install

CDN

<script src="https://unpkg.com/@yakoue/vue-email-builder"></script>

NPM

$ npm install @yakoue/vue-email-builder --save
or
$ yarn @yakoue/vue-email-builder

Usage

Next, you'll need to import the Email Builder component to your app.

<template>
  <div id="example">
    <div class="container">
      <div id="bar">
        <h1>Vue Email Editor (Demo)</h1>

        <button @click="saveDesign">Save Design</button>
        <button @click="exportHtml">Export HTML</button>
      </div>

      <EmailBuilder ref="emailbuilder" :config="config" @load="editorLoaded" />
    </div>
  </div>
</template>

<script>
import EmailBuilder from '@yakoue/vue-email-builder'
export default {
  name: 'Example',
  components: {
    EmailBuilder,
  },
  data() {
    return {
      config: {},
      emailTemplate: `<mjml> 
<mj-body> 
    <mj-section> 
        <mj-column> 
            <mj-text>
                <h1> Hey Title! </h1> 
            </mj-text>
                <mj-button> Hi nestor! </mj-button>
        </mj-column>
    </mj-section>  
</mj-body> 
</mjml>`,
    }
  },
  methods: {
    editorLoaded(instance) {
      //
      this.instance = instance
      this.instance.addEvent('onExport', (data) => {
        console.log('exportHtml', data)
      })
      this.instance.setTemplate(emailTemplate)
    },
    saveTemplate() {
      this.addEvent('onSave', (template) => {
        console.log('saveTemplate', JSON.stringify(template, null, 2))
      })
      this.instance.save()
    },
    exportHtml() {
      this.instance.export()
    },
  },
}
</script>

Methods

MethodParamdescription
setTemplatetemplateTake the template and load it to the builder
saveTemplateFunction callbackReturns the design JSON and HTML in a callback function
exportHtmlFunction callbackReturns the design HTML in a callback function

Properties

template object or string You can set MJML Json on MJML XML as string to this props

config object You can use this props to config and customize the builder

onLoad function callback You can use this to set call back function on builder load

Configuration Options


AttributeRequired
brand
object
NoThis is the Brand Object from Yakoue. You can get it from the Brand settings page.
locale
string
NoThis is the locale you want to load the editor in. We have many translations available.
fusionTags
object
NoThis is an array of objects. You can pass the merge tags and special links to display in the editor.
token
string
NoString token for authentication. It is required to enable user saved blocks.
tools
object
NoThese are the options for tools and custom tools.
blocks
object
NoThis is an array of objects. You can pass custom blocks here.
drows
object
NoThis is an array of objects. You can pass custom rows (sections) here.
body
object
NoThis objects to custom default template settings
editor
object
NoThese are some editor options for different functions of the editor.
fonts
object
NoYou can pass custom fonts here.
toolsDefaultValues
object
NoYou can pass default tools properties here.
callbacks
array
NoArray of callbacks functions

Customize configuration

See Configuration Reference.

For any report please write to contact@yakoue.com

Keywords

FAQs

Last updated on 09 May 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc