Add the dependency in your project's composer.json:
"require": {
"practo/communicator-bundle": "dev-master"
},
"repositories": [
{
"type": "vcs",
"url": "git@github.com:practo/CommunicatorBundle.git"
}
]
Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:
$ composer update practo/communicator-bundleThis command requires you to have Composer installed globally, as explained in the installation chapter of the Composer documentation.
Then, enable the bundle by adding it to the list of registered bundles
in the app/AppKernel.php file of your project:
<?php
// app/AppKernel.php
// ...
class AppKernel extends Kernel
{
public function registerBundles()
{
$bundles = array(
// ...
new Practo\CommunicatorBundle\PractoCommunicatorBundle(),
);
// ...
}
// ...
}Communicator has 4 required parameters, add them to your parameters.yml
communicator.queue.uri: beanstalk://localhost/
communicator.base_uri: replace-with-communicator-url
communicator.api.secret: replace-with-communicator-api-secret
communicator.api.app_name: replace-with-application-name
communicator.s3.bucket: attachment-bucket-name
There are no release tags for this bundle. If you want to update, please use commit references.
- Update commit reference in your
composer.lock:
{
"name": "practo/communicator-bundle",
"version": "dev-master",
"target-dir": "Practo/CommunicatorBundle",
"source": {
"type": "git",
"url": "git@github.com:practo/CommunicatorBundle.git",
"reference": "" /* Update this reference to your target commit hash */
},
},
- Run the following command to update composer hash:
$ composer update --lock- Below is snippet to send doctor sms:
$sms = $this->container->get('practo_communicator.sms_doctor');
$sms>sendSms(
$reference_id, $reference_type,
$name, $to, $messageType, $body,
$notes = null, $expiryTime = null
);- Below is snippet to send staff mail:
$mailStaff = $this->container->get('practo_communicator.mail_staff');
$mailStaff->sendMail(
$fromName, $fromMail, $toName = "", $to,
$cc = "", $bcc = "", $subject, $body, $type,
$files, $hash, $plaintext = "", $replyTo = NULL,
$reference_id = NULL, $reference_type = NULL,
$expiryTime = NULL, $appName = null)s = null, $expiryTime = null
);- Getting error pheanstalk_pheanstalk not found
There are two ways to solve it.
- Use version ~2.1 of pheanstalk.
- In communicatatorbundle change pheanstalk_pheanstalk to pheanstalk/pheanstalk.