"use strict";
/**
 * EmailConfig is responsible for geting and saveing configuration to database
 */
angular.module('monsart').service('EmailConfig', ['$http', 'Globals', function ($http, Globals) {
        this.getTemplateConfigs = function () {
            $http.get(ajaxUrl, {
                'action': 'ma_email',
                'order': Globals.order
            });
        }
        this.saveConfig = function (data) {

            return $http({
                method : 'POST',
                url : Globals.ajaxUrl,
                params: {
                    nonce: Globals.nonce,
                    func: 'saveConfig',
                    action: 'ma_ajax_main',
                    order: Globals.order

                },
                data: data,
                headers: {
                    'Content-Type': 'application/x-www-form-urlencoded'
                },
                
            }).then(function (response) {
                
            });
        }


    }]);