Call some Mautic API urls from command line
Switch branches/tags
Nothing to show
Clone or download
Latest commit fc41084 Jun 9, 2017
Failed to load latest commit information.
.gitignore First commit May 24, 2017 First commit May 24, 2017
composer.json First commit May 24, 2017
composer.lock First commit May 24, 2017
mautic.php Minor changes Jun 9, 2017

What is it for?

This script allows you to create a new segment email on your Mautic installation from command line. You can use this to automate marketing messages. It uses Mautic "Basic authentication", so you should NOT use this without SSL (https).


  • All Mautic PHP API requirements

Command line example

php mautic.php --baseUrl <yout Mautic base url> --userName <mautic username> --password <mautic password> --emailName "Email Name" --emailSubject "Email subject" --emailHtml "<b>This is your email!</b>" --emailSegments 7,3,1


  • baseUrl: your Mautic url installation.
  • userName: username used to login at Mautic
  • password: password for the user above
  • emailName: the name of email on Mautic
  • emailSubject: the email subject
  • emailHtml: the content of email itself
  • emailSegments: comma separated list of Mautic segments ids


  • returns 0 on a successfull execution.
  • returns != 0 otherwise

Also returns the JSON enconded response from Mautic API email/new endpoint.