PAM Marketing Automation Email + HTML Builder
npm install @pamsai/pam-builderBuild Package (Include Store)
1. Run Command
```
yarn add @pamsai/pam-builder
2. Run Command
``
yarn dev`
or`
npm run dev
3. Setup Data To Local Storage
`javascript
get storageBaseUrl() {
return
}
get storageToken() {
return
}
[Optional]
get personalizeBaseUrl() {
return
}
get personalizeToken() {
return
}
created() {
if (process.client) {
localStorage['storage-baseurl'] = this.storageBaseUrl
localStorage['storage-token'] = this.storageToken
[Optional]
localStorage['personalize-baseurl'] = this.personalizeBaseUrl
localStorage['personalize-token'] = this.personalizeToken
}
}
`
| attribute |value |type |description |
|----------------------------------------|:------------------------:|:--------:| -------------------------------------------------------------------------------------------- |
|storageBaseUrl |up to you |string |for get or upload image (ex. [GET] , [POST] |string
|storageToken |up to you | |for access api get or upload image |string
|personalizeBaseUrl (optional) |up to you | |for get personalize (ex. [GET] )* |string
|personalizeToken (optional) |up to you | |for access api get personalize |
4. Import Module And Create Instance Vue Component
`javascript#${this.id}
[Vue]
mounted() {
const builder: any = require('~/node_modules/vue-builder-plugin/src/plugins/Module')
const store = builder.default.store
const router = builder.default.router
const self = this
new Vue({
router,
store,
render: (h) =>
h(builder.default.component, {
props: {
propTemplateJson: this.propTemplateJson,
propMessageType: this.propMessageType
},
on: {
change(templateJson: any) {
self.$emit('change', (templateJson && !_.isEmpty(templateJson) ? templateJson : {}))
}
}
})
}).$mount()
}
[Nuxt.js]
mounted() {
if (process.client) {
const builder: any = require('~/node_modules/vue-builder-plugin/src/plugins/Module')
const store = builder.default.store
const router = builder.default.router
const self = this
new Vue({
router,
store,
render: (h) =>
h(builder.default.component, {
props: {
propTemplateJson: this.propTemplateJson,
propMessageType: this.propMessageType
},
on: {
change(templateJson: any) {
self.$emit('change', (templateJson && !_.isEmpty(templateJson) ? templateJson : {}))
}
}
})
}).$mount(#${this.id})`
}
}
| attribute |value |type |description |
|----------------------------------------|:--------------------------------:|:--------:| -------------------------------------------------------------------------------------------- |
|id |up to you |string |for create element (default: builder). Mutiple element should be setup difference name |object
|store |- |- |for use store in builder component module |
|router |- |- |for use router in builder component module |
|propTemplateJson |up to you | |for setup default prop your template json (pass to builder module) |string
|propMessageType |EMAIL, WEB_ATTENTION, FLEX_MESSAGE| |for setup default prop your message type (EMAIL: result mjml, WEB_ATTENTION: result html, FLEX_MESSAGE: result line flex message) |any
|this.builder |up to you | |for save vue instance data (parameter in your component) |function
|render |- ||for render component |function
|change(templateJson: any) |- ||for pass updated data from child (module component) to parent (your component) component |#${this.id}
|.$mount() |- |- |for create instance vue |
5. Use Component
`html`
| attribute |value |type |description |
|----------------------------------------|:------------------------:|:--------:| -------------------------------------------------------------------------------------------- |
|id |up to you |string |for create element (default: builder). Mutiple element should be setup difference name |
6. Import Style To Component
`javascript`
7. Access Builder Instance Directive From Outside
`javascript
(window as any).$el.__vue__.
such as
(window as any).$el.__vue__.onUpdateScreen({
mobile: this.isMobileActive,
desktop: this.isFullsceenActive,
width: {
type: this.propWidthScreenType,
size: this.propWidthScreenSize
}
})
`
| attribute |value |type |description |
|----------------------------------------|:-----------------------------:|:--------:| ----------------------------------------------------------------------------------------------- |
|isMobileActive |true, false |boolean |for set up screen (if value is true you can view on mobile screen only) |boolean
|isFullsceenActive |true, false | |for set up screen (if value is true you can view on desktop screen only) |object
|width |{ type: string, size: string } | |for set up width and type screen (if you set value you still edit builder) |string
|propWidthScreenType |SM, MD, LG, FULL, CUSTOM | |for set up screen type (SM: 30%, MD: 70%, LG: 50%, FULL: 100%, CUSTOM: up to you, DEFAULT: 90%)|string
|propWidthScreenSize |number of percent (ex. 25%) | |for set up screen custom |
yarn install
`#### Compiles and hot-reloads for development
`
yarn dev
`#### Compiles and minifies for production
`
yarn build:ts
`#### Lints and fixes files
`
yarn lint
``