bigfoot / ecircle-bundle
Bigfoot ecircle bundle
Installs: 4 600
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 15
Forks: 1
Open Issues: 0
Type:symfony-bundle
Requires
- bigfoot/core-bundle: ~2.2.0
This package is auto-updated.
Last update: 2024-10-29 04:30:52 UTC
README
EcircleBundle is part of the framework BigFoot created by C2IS.
Installation
Add 'bigfoot/ecircle-bundle' into your composer.json file in the 'require' section:
// composer.json "require": { ... ... "bigfoot/ecircle-bundle": "dev-master", }
Update your project:
php composer.phar update
Enter your credentials in the config file:
# app/config.yml ... ... parameters: bigfoot_ecircle: client: wsdl_url: 'http://webservices.ecircle-ag.com/soap/ecm.wsdl' request: account_1: realm: 'http://your-ecircle-url.com' user: 'User' passwd: 'Password'
Create a class file into the directory Options with the name of the E-circle method followed by 'Options':
// src/Bigfoot/Bundle/EcircleBundle/Options/SubscribeMemberByEmailOptions.php namespace Bigfoot\Bundle\EcircleBundle\Options; class subscribeMemberByEmailOptions { public $email; public $groupId; public $session; public $sendMessage = false; }
The parameters must be the same as the Ecircle method.
Create a new method in the service 'bigfoot_ecircle.client':
// src/Bigfoot/Bundle/EcircleBundle/Services/BigfootEcircleClient.php public function subscribeMemberByEmail($email,$groupId) { if (!$this->sessionId) { throw new Exception('Client no connected'); } $subscribeMemberByEmailOptions = $this->options('SubscribeMemberByEmail'); $subscribeMemberByEmailOptions->email = $email; $subscribeMemberByEmailOptions->session = $this->sessionId; $subscribeMemberByEmailOptions->groupId = $groupId; $result = $this->client->subscribeMemberByEmail($subscribeMemberByEmailOptions); return $result; }
Usage
Into an action method:
// Controller/DefaultController.php $client = $this->get('bigfoot_ecircle.client')->connect('account_1'); $retour = $client->subscribeMemberByEmail('example@email.com','99'); $client->disconnect();