Code Monkey home page Code Monkey logo

mautic-enhancer's Introduction

Mautic Enhancer Latest Stable Version License Build Status

Age from BirthdateAlcazarFourleafRandomXverify

A bundle of contact data enhancers.

External Enhancers

  • Alcazar - Phone data lookup
  • Fourleaf - Contact activity and hygiene scoring
  • XVerify - Validates email and phone fields

Local Enhancers

  • Random - Stores random number for use in A/B splits
  • Age from Birthdate - Stores age based on a birthdate field
  • City & State from Postal Code - Backfills blank city/state fields when the postal(zip) is filled. IP Address data can be used to enhance the data.
  • Choose Gender From Name - Selects the most probble gender based on a contacts first name.

Installation & Usage

Currently being tested with Mautic 2.12.x. If you have success/issues with other versions please report.

  1. Install by running composer require thedmsgroup/mautic-enhancer-bundle or by unpacking this repository's contents into a folder named /plugins/MauticEnhancerBundle
  2. Go to /s/plugins and click Install/Upgrade Plugins.
  3. Publish and configure the integrations as you wish.
  4. For City & State From Postal Code and Gender From Name, use the console commands (mautic:integration:enhancer:installcspcdata and mautic:integration:enhancer:installgendernames, respectively) to build the reference tables.

Expirian Correct Address

Correct Address is a data enhancer dependent on Expirian's proprietary qas software.

Set up - Enabled/Auth

  • Host User and Host Password are assigned by Expirian
  • Fingerprint and be found by loging onto the SFTP sight then looking through the connection properties

Set up - Features

  • Remote Host Expirian assingned
  • Remote Path, Archive, and Path should not change
  • Excecuable Path: the absolute path to the location of the CorrectAddress calling program
  • Local Data Path: the absolute path to where the data file is extracted

mautic-enhancer's People

Contributors

cykonetic avatar heathdutton avatar joeyleadjig avatar scottshipman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mautic-enhancer's Issues

Duplicated Enhancer Fields

AgeFromDateofBirth had several duplicated fields in the lead_fields table. Some were built before the installed field check was built, but not all. This needs to be cleaned up and corrected....The other enhancers should be checked as well.

SQL error trying to enable Age from Birthdate

FYI extended-field is also installed, and enabled.

'disable_lead_table_fields' => 1,

[2019-01-16 13:57:07] mautic.CRITICAL: Uncaught PHP Exception Doctrine\DBAL\Exception\DriverException: "An exception occurred while executing 'INSERT INTO audit_log (user_id, user_name, bundle, object, object_id, action, details, date_added, ip_address) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)' with params [3, "Virgil .", "lead", "field", "", "create", "a:5:{s:5:\"alias\";a:2:{i:0;N;i:1;s:7:\"afb_age\";}s:4:\"type\";a:2:{i:0;s:4:\"text\";i:1;s:6:\"number\";}s:6:\"object\";a:2:{i:0;s:4:\"lead\";i:1;s:13:\"extendedField\";}s:5:\"label\";a:2:{i:0;N;i:1;s:3:\"Age\";}s:10:\"properties\";a:2:{i:0;a:0:{}i:1;s:62:\"a:3:{s:9:\"roundmode\";i:6;s:5:\"scale\";i:0;s:9:\"precision\";i:0;}\";}}", "2019-01-16 03:57:07", "101.162.1.1"]:

SQLSTATE[HY000]: General error: 1366 Incorrect integer value: '' for column 'object_id' at row 1" at /var/www/torpedo/mautic/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php line 115 {"exception":"[object] (Doctrine\\DBAL\\Exception\\DriverException(code: 0): An exception occurred while executing 'INSERT INTO audit_log (user_id, user_name, bundle, object, object_id, action, details, date_added, ip_address) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)' with params [3, \"Virgil .\", \"lead\", \"field\", \"\", \"create\", \"a:5:{s:5:\\\"alias\\\";a:2:{i:0;N;i:1;s:7:\\\"afb_age\\\";}s:4:\\\"type\\\";a:2:{i:0;s:4:\\\"text\\\";i:1;s:6:\\\"number\\\";}s:6:\\\"object\\\";a:2:{i:0;s:4:\\\"lead\\\";i:1;s:13:\\\"extendedField\\\";}s:5:\\\"label\\\";a:2:{i:0;N;i:1;s:3:\\\"Age\\\";}s:10:\\\"properties\\\";a:2:{i:0;a:0:{}i:1;s:62:\\\"a:3:{s:9:\\\"roundmode\\\";i:6;s:5:\\\"scale\\\";i:0;s:9:\\\"precision\\\";i:0;}\\\";}}\", \"2019-01-16 03:57:07\", \"101.162.1.1\"]:

SQLSTATE[HY000]: General error: 1366 Incorrect integer value: '' for column 'object_id' at row 1 at /var/www/torpedo/mautic/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:115, Doctrine\\DBAL\\Driver\\PDOException(code: HY000): SQLSTATE[HY000]: General error: 1366 Incorrect integer value: '' for column 'object_id' at row 1 at /var/www/torpedo/mautic/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:107, PDOException(code: HY000): SQLSTATE[HY000]: General error: 1366 Incorrect integer value: '' for column 'object_id' at row 1 at /var/www/torpedo/mautic/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:105)
[stacktrace]
#0 /var/www/torpedo/mautic/vendor/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php(128): Doctrine\\DBAL\\Driver\\AbstractMySQLDriver->convertException('An exception oc...', Object(Doctrine\\DBAL\\Driver\\PDOException))
#1 /var/www/torpedo/mautic/vendor/doctrine/dbal/lib/Doctrine/DBAL/Statement.php(177): Doctrine\\DBAL\\DBALException::driverExceptionDuringQuery(Object(Doctrine\\DBAL\\Driver\\PDOMySql\\Driver), Object(Doctrine\\DBAL\\Driver\\PDOException), 'INSERT INTO aud...', Array)
#2 /var/www/torpedo/mautic/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php(281): Doctrine\\DBAL\\Statement->execute()
#3 /var/www/torpedo/mautic/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php(1014): Doctrine\\ORM\\Persisters\\Entity\\BasicEntityPersister->executeInserts()
#4 /var/www/torpedo/mautic/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php(378): Doctrine\\ORM\\UnitOfWork->executeInserts(Object(Doctrine\\ORM\\Mapping\\ClassMetadata))
#5 /var/www/torpedo/mautic/vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php(356): Doctrine\\ORM\\UnitOfWork->commit(Object(Mautic\\CoreBundle\\Entity\\AuditLog))
#6 /var/www/torpedo/mautic/app/bundles/CoreBundle/Entity/CommonRepository.php(801): Doctrine\\ORM\\EntityManager->flush(Object(Mautic\\CoreBundle\\Entity\\AuditLog))
#7 /var/www/torpedo/mautic/app/bundles/CoreBundle/Model/AuditLogModel.php(65): Mautic\\CoreBundle\\Entity\\CommonRepository->saveEntity(Object(Mautic\\CoreBundle\\Entity\\AuditLog))
#8 /var/www/torpedo/mautic/app/bundles/LeadBundle/EventListener/LeadSubscriber.php(181): Mautic\\CoreBundle\\Model\\AuditLogModel->writeToLog(Array)
#9 [internal function]: Mautic\\LeadBundle\\EventListener\\LeadSubscriber->onFieldPostSave(Object(Mautic\\LeadBundle\\Event\\LeadFieldEvent), 'mautic.lead_fie...', Object(Symfony\\Component\\EventDispatcher\\ContainerAwareEventDispatcher))
#10 /var/www/torpedo/mautic/vendor/symfony/event-dispatcher/EventDispatcher.php(184): call_user_func(Array, Object(Mautic\\LeadBundle\\Event\\LeadFieldEvent), 'mautic.lead_fie...', Object(Symfony\\Component\\EventDispatcher\\ContainerAwareEventDispatcher))
#11 /var/www/torpedo/mautic/vendor/symfony/event-dispatcher/EventDispatcher.php(46): Symfony\\Component\\EventDispatcher\\EventDispatcher->doDispatch(Array, 'mautic.lead_fie...', Object(Mautic\\LeadBundle\\Event\\LeadFieldEvent))
#12 /var/www/torpedo/mautic/plugins/MauticEnhancerBundle/Integration/AbstractEnhancerIntegration.php(135): Symfony\\Component\\EventDispatcher\\EventDispatcher->dispatch('mautic.lead_fie...', Object(Mautic\\LeadBundle\\Event\\LeadFieldEvent))
#13 /var/www/torpedo/mautic/plugins/MauticEnhancerBundle/EventListener/PluginSubscriber.php(44): MauticPlugin\\MauticEnhancerBundle\\Integration\\AbstractEnhancerIntegration->buildEnhancerFields()
#14 [internal function]: MauticPlugin\\MauticEnhancerBundle\\EventListener\\PluginSubscriber->buildEnhancerFields(Object(Mautic\\PluginBundle\\Event\\PluginIntegrationEvent), 'mautic.plugin_o...', Object(Symfony\\Component\\EventDispatcher\\ContainerAwareEventDispatcher))
#15 /var/www/torpedo/mautic/vendor/symfony/event-dispatcher/EventDispatcher.php(184): call_user_func(Array, Object(Mautic\\PluginBundle\\Event\\PluginIntegrationEvent), 'mautic.plugin_o...', Object(Symfony\\Component\\EventDispatcher\\ContainerAwareEventDispatcher))
#16 /var/www/torpedo/mautic/vendor/symfony/event-dispatcher/EventDispatcher.php(46): Symfony\\Component\\EventDispatcher\\EventDispatcher->doDispatch(Array, 'mautic.plugin_o...', Object(Mautic\\PluginBundle\\Event\\PluginIntegrationEvent))
#17 /var/www/torpedo/mautic/app/bundles/PluginBundle/Controller/PluginController.php(266): Symfony\\Component\\EventDispatcher\\EventDispatcher->dispatch('mautic.plugin_o...', Object(Mautic\\PluginBundle\\Event\\PluginIntegrationEvent))
#18 /var/www/torpedo/mautic/vendor/symfony/http-kernel/HttpKernel.php(135): Mautic\\PluginBundle\\Controller\\PluginController->configAction('AgeFromBirthdat...', 'details-contain...', 0)
#19 /var/www/torpedo/mautic/vendor/symfony/http-kernel/HttpKernel.php(57): Symfony\\Component\\HttpKernel\\HttpKernel->handleRaw(Object(Symfony\\Component\\HttpFoundation\\Request), 1)
#20 /var/www/torpedo/mautic/vendor/symfony/http-kernel/DependencyInjection/ContainerAwareHttpKernel.php(67): Symfony\\Component\\HttpKernel\\HttpKernel->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)
#21 /var/www/torpedo/mautic/vendor/symfony/http-kernel/Kernel.php(183): Symfony\\Component\\HttpKernel\\DependencyInjection\\ContainerAwareHttpKernel->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)
#22 /var/www/torpedo/mautic/app/AppKernel.php(141): Symfony\\Component\\HttpKernel\\Kernel->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)
#23 /var/www/torpedo/mautic/app/middlewares/CORSMiddleware.php(93): AppKernel->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)
#24 /var/www/torpedo/mautic/app/middlewares/CatchExceptionMiddleware.php(45): Mautic\\Middleware\\CORSMiddleware->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)
#25 /var/www/torpedo/mautic/app/middlewares/VersionCheckMiddleware.php(57): Mautic\\Middleware\\CatchExceptionMiddleware->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)
#26 /var/www/torpedo/mautic/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Mautic\\Middleware\\VersionCheckMiddleware->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)
#27 /var/www/torpedo/mautic/vendor/stack/run/src/Stack/run.php(13): Stack\\StackedHttpKernel->handle(Object(Symfony\\Component\\HttpFoundation\\Request))
un(Object(Stack\\StackedHttpKernel))p(37): Stack\
#29 {main}

Age from birthdate - source field name

I installed the plugin, but I couldn't make 'Age from birthdate' function to work.
I couldn't find documentation about this issue, so I digged into the code and found out that the enhancement works only from hardcoded source fields, namely 'dob_year', 'dob_month', 'dob_day'. Newer version works with field named 'dob' too.

I however already have a field named 'birthday' to store birthdays. Now I'm stuck. In order to use this function I would have to change my mautic application to use the field 'dob', instead of my previously existent 'birthday' and migrate data from one field to another.

It would be nice to set the source field name in the plugin configuration just like the field name for random number is needed to set.

thanks

type error in LeadSubscriber

Mautic version: 2.14.1
Mautic-enhancer version: 2.14.2

I accedentally run mautic (2.14.1) with enhancer version 2.14.2. due to composer version set to "~2".
This cross-version usage causes a type error:

mautic.ERROR: PHP Error - Object of class DateTime could not be converted to string - in file /var/www/html/plugins/MauticEnhancerBundle/EventListen
er/LeadSubscriber.php - at line 71 [] []

I wonder if the same happens with mautic 2.14.2.
Anyway, I reverted enhancer version to 2.14.0. I just thought I should leave a note about the issue.

Need a way to check if reference table existence

We use mautic in a K8S/docker environment. I included the mautic:integration:enhancer:installcspcdata command into the entrypoint.sh to ensure that the command is run if a new instance is launched.
However it also runs whenever I upgrade versions and restart the container.

Is there a way to include a status check in the command to prevent lengthy database requests from happenning is the reference table is present and up to date?

LeadSubscriber wrong data type

My email links (if rewritten by Mautic) do not work properly, there is an error:

mautic.ERROR: PHP Error - Object of class DateTime could not be converted to string - in file /var/app/current/plugins/MauticEnhancerBundle/EventListener/LeadSubscriber.php - at line 71

I wasn't able to find the reason for this error yet ... Any ideas?

Unknown column 'gender' in 'field list'

mautic:integration:enhancer:installgendernames had been previously run on initial installation. Just hadn't gotten around to adding a new contact to this instance.

NB extended-fields is also installed.

[2019-01-16 13:08:47] mautic.NOTICE: PHP Notice - Undefined index: gender - in file /var/www/torpedo/mautic/plugins/MauticExtendedFieldBundle/Entity/ExtendedFieldRepositoryTrait.php - at line 249
[2019-01-16 13:08:47] mautic.CRITICAL: Uncaught PHP Exception Doctrine\DBAL\Exception\InvalidFieldNameException: "An exception occurred while executing 'UPDATE leads SET preferred_locale = ?, gender = ? WHERE id = ?' with params ["en_AU", "M", 27]:

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'gender' in 'field list'" at /var/www/torpedo/mautic/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php line 71 {"exception":"[object] (Doctrine\\DBAL\\Exception\\InvalidFieldNameException(code: 0): An exception occurred while executing 'UPDATE leads SET preferred_locale = ?, gender = ? WHERE id = ?' with params [\"en_AU\", \"M\", 27]:

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'gender' in 'field list' at /var/www/torpedo/mautic/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:71, Doctrine\\DBAL\\Driver\\PDOException(code: 42S22): SQLSTATE[42S22]: Column not found: 1054 Unknown column 'gender' in 'field list' at /var/www/torpedo/mautic/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:107, PDOException(code: 42S22): SQLSTATE[42S22]: Column not found: 1054 Unknown column 'gender' in 'field list' at /var/www/torpedo/mautic/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:105)
[stacktrace]
#0 /var/www/torpedo/mautic/vendor/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php(128): Doctrine\\DBAL\\Driver\\AbstractMySQLDriver->convertException('An exception oc...', Object(Doctrine\\DBAL\\Driver\\PDOException))
#1 /var/www/torpedo/mautic/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(1015): Doctrine\\DBAL\\DBALException::driverExceptionDuringQuery(Object(Doctrine\\DBAL\\Driver\\PDOMySql\\Driver), Object(Doctrine\\DBAL\\Driver\\PDOException), 'UPDATE leads SE...', Array)
#2 /var/www/torpedo/mautic/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(678): Doctrine\\DBAL\\Connection->executeUpdate('UPDATE leads SE...', Array, Array)
#3 /var/www/torpedo/mautic/plugins/MauticExtendedFieldBundle/Entity/ExtendedFieldRepositoryTrait.php(265): Doctrine\\DBAL\\Connection->update('leads', Array, Array)
#4 /var/www/torpedo/mautic/plugins/MauticExtendedFieldBundle/Model/OverrideLeadModel.php(251): MauticPlugin\\MauticExtendedFieldBundle\\Entity\\OverrideLeadRepository->saveEntity(Object(Mautic\\LeadBundle\\Entity\\Lead))
#5 /var/www/torpedo/mautic/app/bundles/LeadBundle/Controller/LeadController.php(449): MauticPlugin\\MauticExtendedFieldBundle\\Model\\OverrideLeadModel->saveEntity(Object(Mautic\\LeadBundle\\Entity\\Lead))
#6 /var/www/torpedo/mautic/app/bundles/CoreBundle/Controller/CommonController.php(475): Mautic\\LeadBundle\\Controller\\LeadController->newAction(0, '')
#7 /var/www/torpedo/mautic/vendor/symfony/http-kernel/HttpKernel.php(135): Mautic\\CoreBundle\\Controller\\CommonController->executeAction('new', 0, 0, '')
#8 /var/www/torpedo/mautic/vendor/symfony/http-kernel/HttpKernel.php(57): Symfony\\Component\\HttpKernel\\HttpKernel->handleRaw(Object(Symfony\\Component\\HttpFoundation\\Request), 1)
#9 /var/www/torpedo/mautic/vendor/symfony/http-kernel/DependencyInjection/ContainerAwareHttpKernel.php(67): Symfony\\Component\\HttpKernel\\HttpKernel->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)
#10 /var/www/torpedo/mautic/vendor/symfony/http-kernel/Kernel.php(183): Symfony\\Component\\HttpKernel\\DependencyInjection\\ContainerAwareHttpKernel->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)
#11 /var/www/torpedo/mautic/app/AppKernel.php(141): Symfony\\Component\\HttpKernel\\Kernel->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)
#12 /var/www/torpedo/mautic/app/middlewares/CORSMiddleware.php(93): AppKernel->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)
#13 /var/www/torpedo/mautic/app/middlewares/CatchExceptionMiddleware.php(45): Mautic\\Middleware\\CORSMiddleware->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)
#14 /var/www/torpedo/mautic/app/middlewares/VersionCheckMiddleware.php(57): Mautic\\Middleware\\CatchExceptionMiddleware->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)
#15 /var/www/torpedo/mautic/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Mautic\\Middleware\\VersionCheckMiddleware->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)
#16 /var/www/torpedo/mautic/vendor/stack/run/src/Stack/run.php(13): Stack\\StackedHttpKernel->handle(Object(Symfony\\Component\\HttpFoundation\\Request))
#17 /var/www/torpedo/mautic/index.php(37): Stack\^Mun(Object(Stack\\StackedHttpKernel))
#18 {main}
"}
[2019-01-16 03:13:09] mautic.INFO: names.zip downloaded
[2019-01-16 03:13:09] mautic.INFO: Archive extracted to /tmp/genderNames/

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.