# weforms/1.5.4/includes/integrations/mailpoet/component/index.js

weForms – Easy Drag &amp; Drop Contact Form Builder For WordPress, version 1.5.4. 45 lines.

- Page: https://pluginprobe.com/plugins/weforms/1.5.4/code/includes/integrations/mailpoet/component/index.js
- Raw: https://pluginprobe.com/plugins/weforms/1.5.4/raw/includes/integrations/mailpoet/component/index.js
- Modified: 2020-10-20T13:26:26+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/weforms/1.5.4/code/includes/integrations/mailpoet/component/index.js#L10-L20`.

```javascript
;(function($) {

    Vue.component('wpuf-integration-mailpoet', {
        template: '#tmpl-wpuf-integration-mailpoet',
        mixins: [wpuf_mixins.integration_mixin],

        data: function() {
            return {
                lists: []
            };
        },

        computed: {

        },

        created: function() {
            this.fetchLists();
        },

        methods: {

            fetchLists: function(target) {
                var self = this;

                wp.ajax.send('wpuf_mailpoet_fetch_lists', {
                    data: {
                        _wpnonce: weForms.nonce
                    },

                    success: function(response) {
                        self.lists = response;
                    },
                });
            },

            insertValue: function(type, field, property) {
                var value = ( field !== undefined ) ? '{' + type + ':' + field + '}' : '{' + type + '}';

                this.settings.fields[property] = value;
            }
        }
    });

})(jQuery);
```
