PHP code example of intracto / campaign-monitor-bundle

1. Go to this page and download the library: Download intracto/campaign-monitor-bundle library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

intracto / campaign-monitor-bundle example snippets

 bash
$ php composer.phar update intracto/campaign-monitor-bundle
 php

// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        ...
        new Intracto\CampaignMonitorBundle\IntractoCampaignMonitorBundle(),
    );
}
 php


use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;

class ClientController extends Controller
{
	/**
	* @var Request $request
	* @return Response
	*/
	public function subscriberListsAction(Request $request)	
	{
		$clientConnectorFactory = $this->get('itr.campaign_monitor.factory.client_connector');
		
		$clientId = $this->getParameter('your_client_id');
		$clientConnector = $clientConnectorFactory->getConnectorForId($clientId);
		
		/** @var ListReference[]|ArrayCollection $lists */
		$lists = $clientConnector->getLists();
		
		return $this->render('your_template_file.html.twig', ['lists' => $lists]);
	}
	
	...
}