Code Monkey home page Code Monkey logo

mautic-limiter-bundle's Introduction

Limiter for Mautic

This plugin disable Mautic features after extend limit of number of identified contacts. You can hide create new contact, new email, campaigns or editation too.

Installation

Manual

  1. Use last version
  2. Unzip files to plugins/MauticLimiterBundle
  3. Clear cache (app/cache/prod/)
  4. Go to /s/plugins/reload

Usage

Configure Limiter from config (app/config/local.php)

'limiter'                               => [
    'limit'   => 5000, 
    'routes'  => [
         '*campaigns/new',
         '*campaigns',
         '*contacts/new',
         '*contacts/edit/*',
    ],
 'message' => '<h3>Contacts limit: {numberOfContacts}/{actualLimit}</h3><p>You have reached the limit  of contacts. <a href="bttps://mtcextendee.com/contact"><strong>contact support</strong></a></p>',
    'style'=>'.alert-limiter-custom { background:red; color:#fff; }',
]

Parameters

  • limit = number for identified contacts to stop (0 means unlimited)
  • message - your message (allow HTML)
  • routes - array of url routes with wildcard
  • style - css style for alert message (class .alert-limiter-custom)

Every change require clear cache (app/cache/prod/)

Tokens

You can use in message these tokens

  • {numberOfContacts}
  • {actualLimit}

API

GET

$api = new \Mautic\Api\Api($auth, $apiUrl);
$response = $api->makeRequest('limiter/get'); // get all settings
$response = $api->makeRequest('limiter/message/get'); // get message setting
$response = $api->makeRequest('limiter/limit/get'); // get limit setting
$response = $api->makeRequest('limiter/routes/get'); // get routes setting
$response = $api->makeRequest('limiter/routes/style'); // get style setting

Response

Array
(
    [response] => Any response from your request
)

UPDATE

$api = new \Mautic\Api\Api($auth, $apiUrl);
$response = $api->makeRequest(
    'limiter/message/update',
    [
        'limit' => 'My custom message'
    ],
    'POST'
);
$response = $api->makeRequest(
    'limiter/style/update',
    [
        'style' => 'My custom message'
    ],
    'POST'
);
$response = $api->makeRequest(
    'limiter/limit/update',
    [
        'limit' => 1000
    ],
    'POST'
);
$response = $api->makeRequest(
    'limiter/routes/update',
    [
        'routes' => [
            'mautic_campaign_action' => [
                'objectAction' => 'new',
            ],
        ],
    ],
    'POST'
);

Response

Array
(
    [success] => 1
)

More Mautic stuff

Credits

Icons made by Freepik

mautic-limiter-bundle's People

Contributors

kuzmany avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.