fmdd/sylius-marketing-plugin

FMDD marketing plugin for Sylius.

Installs: 3 408

Dependents: 1

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

Type:sylius-plugin


README

FM2D logo Sylius logo

FM2D - SyliusMarketingBundle

License Latest Stable Version Total Downloads PHP Version Require Slack Support

FM2D is a Web Agency publisher of Sylius plugins and open source actor. Since 2016, we strive to produce useful plugins to improve your e-commerce store. FM2D also offers you a first class technical support and customer service.

Summary

Overview

Marketing bundle is use for :

  • Add TrustPilot bundle from Setono\SyliusTrustpilotPlugin
  • Email cart abandoned or cart not payed
  • Notification Proof of purchase
  • Add Instagram

TODO :

  • Add multiple email marketing
  • Add new Notification Type

Installation

Step 1: Download the plugin

Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:

$ composer require fmdd/sylius-marketing-plugin

This command requires you to have Composer installed globally, as explained in the installation chapter of the Composer documentation.

Step 2: Enable the plugin

Then, enable the plugin by adding it to the end of the list of registered plugins/bundles in config/bundles.php file of your project.

<?php
# config/bundles.php
return [
    // ...
    Setono\SyliusTrustpilotPlugin\SetonoSyliusTrustpilotPlugin::class => ['all' => true],
    FMDD\SyliusMarketingPlugin\FMDDSyliusMarketingPlugin::class => ['all' => true],
    // ...
];

Step 3: Configure the plugin

# config/packages/_sylius.yaml
imports:
    # ...
    - { resource: "@FMDDSyliusMarketingPlugin/Resources/config/config.yml" }

Step 4: Add the plugin routing to your application

# config/routes/sylius_admin.yaml
sylius_marketing_plugin:
    resource: "@FMDDSyliusMarketingPlugin/Resources/config/routes.yaml"

Step 5: Extend customer and order entities

<?php
// src/Entity/Customer.php

namespace App\Entity\Customer;

use Doctrine\ORM\Mapping as ORM;
use Setono\SyliusTrustpilotPlugin\Model\CustomerTrustpilotAwareInterface;
use Setono\SyliusTrustpilotPlugin\Model\CustomerTrait as TrustpilotCustomerTrait;
use Sylius\Component\Core\Model\Customer as BaseCustomer;

/**
 * @ORM\Table(name="sylius_customer")
 * @ORM\Entity()
 */
class Customer extends BaseCustomer implements CustomerTrustpilotAwareInterface
{
    use TrustpilotCustomerTrait;
}
<?php
// src/Entity/Order.php

namespace App\Entity\Order;

use Doctrine\ORM\Mapping as ORM;
use Setono\SyliusTrustpilotPlugin\Model\OrderTrustpilotAwareInterface;
use Setono\SyliusTrustpilotPlugin\Model\OrderTrait as TrustpilotOrderTrait;
use Sylius\Component\Core\Model\Order as BaseOrder;

/**
 * @ORM\Table(name="sylius_order")
 * @ORM\Entity()
 */
class Order extends BaseOrder implements OrderTrustpilotAwareInterface
{
    use TrustpilotOrderTrait;
}

Add overrides configuration :

# config/packages/_sylius.yml

sylius_customer:
    resources:
        customer:
            classes:
                # If you already have your own CustomerController - use TrustpilotCustomerTrait instead
                controller: Setono\SyliusTrustpilotPlugin\Controller\CustomerController

Step 6 : Add notification system

    ...
    <body>
    ...
       {{ sylius_template_event('fmdd.marketing.shop.layout.notification') }}
    </body>

Reload assets :

php bin/console assets:install
php bin/console sylius:theme:assets:install

You must load orders purchased event notification

$ php bin/console fmdd:notification-order:load

Step 7 : Create notification types

  • purchase
  • trustpilot
  • instagram

Step 8 : If you want to use Instagram oEmbed

parameters:
    fmdd_instagram_client_id: 'your_app_id'
    fmdd_instagram_client_secret: 'your_app_secret'

Additional resources for developers

To learn more about our contribution workflow and more, we encourage you to use the following resources:

License

This plugin's source code is completely free and released under the terms of the MIT license.

Contact

If you have any questions, feel free to contact us by filling our form on our website or send us an e-mail at contact@fm2d.com with your question(s). We will anwser you as soon as possible !