2017 © Pedro Peláez
 

library yii2-mailchimp-ecommerce-event-pusher

MailChimp Ecommerce Event Pusher for Yii2

image

breadhead/yii2-mailchimp-ecommerce-event-pusher

MailChimp Ecommerce Event Pusher for Yii2

  • Friday, March 2, 2018
  • by waytonoway
  • Repository
  • 3 Watchers
  • 0 Stars
  • 5 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 67 % Grown

The README.md

mailchimp-event-pusher

Send events to mailchimp ecommerce, (*1)

do migrations:, (*2)

php yii migrate --migrationPath=@vendor/breadhead/yii2-mailchimp-ecommerce-event-pusher/src/migrations/, (*3)

Implement your model class from MailchimpEventInterface. This ecommerce module for tracking:, (*4)

-Cart, (*5)

-Order, (*6)

-Customer, (*7)

-Product, (*8)

Example of realization:, (*9)

    public function saveMailchimpEvent(string $event_type): MailchimpEvent
        {
            $event = (new MailchimpEvent())->setEntityId($this->id)->setEntityType(MailchimpEvent::CUSTOMER)->setEventType($event_type)->setData($this->getMailchimpData())->save();

            return $event;
        }

        public function getMailchimpData()
        {
            return [
                'id' => (string)$this->id,
                "email_address" =>(string)$this->email,
                'opt_in_status' => (bool)$this->subscribe,
                'first_name' => (string)$this->name,
                'last_name' => (string)$this->last_name,
                'orders_count' => count($this->orders),
                'total_spent' => (float)OrderModel::find()->where(['status' => OrderModel::PAYED, 'customer_id' => $this->id])->sum('total')
            ];
        }

config:, (*10)

'components' => [
    'mailchimpEventPusher' => function () {
        $store_id = <Your mailchimp store id>;
        return new \breadhead\mailchimp\MailchimpEventPusher($store_id);
    }
]

For sending events:, (*11)

\Yii::$app->mailchimpEventPusher->getManager()->sendEvent($event)

The Versions

02/03 2018

dev-master

9999999-dev https://github.com/surzm/bh-yii2-mailchimp-ecommerce-event-pusher.git

MailChimp Ecommerce Event Pusher for Yii2

  Sources   Download

proprietary

The Requires

 

by Avatar surzm

api php yii2 mailchimp

02/03 2018

0.2

0.2.0.0 https://github.com/surzm/bh-yii2-mailchimp-ecommerce-event-pusher.git

MailChimp Ecommerce Event Pusher for Yii2

  Sources   Download

proprietary

The Requires

 

by Avatar surzm

api php yii2 mailchimp

02/03 2018

0.1

0.1.0.0 https://github.com/surzm/bh-yii2-mailchimp-ecommerce-event-pusher.git

MailChimp Ecommerce Event Pusher for Yii2

  Sources   Download

proprietary

The Requires

 

by Avatar surzm

api php yii2 mailchimp