2017 © Pedro Peláez
 

symfony-bundle notification-bundle

Symfony bundle for using notification component with user notify functionality

image

php-solution/notification-bundle

Symfony bundle for using notification component with user notify functionality

  • Thursday, March 30, 2017
  • by cleannoise
  • Repository
  • 1 Watchers
  • 1 Stars
  • 14 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 27 % Grown

The README.md

Notification Bundle

This bundle integrates Notification component to Symfony application., (*1)

Please, see documentation for Notification component before start development., (*2)

Configuration

notification:
    extensions:
        use_for_manager: "notification.extension.context_configurator"
        context_configurator:
            enabled: true
        event_dispatcher:
            enabled: false
    notifier_swiftmailer:
        enabled: true
        default_sender: ~

Installing

  1. Add to your composer.json
    "require": {
        ...
        "php-solution/notification-bundle": "dev-master",
        ...
    }

2) run:, (*3)

    composer update php-solution/notification-bundle

Example

Notification Type:, (*4)

    <?php
    namespace AppBundle\Notification;

    use PhpSolution\Notification\Context;
    use PhpSolution\Notification\Extension\ContextConfigure\ConfiguratorInterface;
    use PhpSolution\Notification\Rule\RuleInterface;
    use PhpSolution\Notification\Type\AbstractType;
    use PhpSolution\NotificationBundle\Notifier\SwiftMailer\Rule;
    use Symfony\Component\OptionsResolver\OptionsResolver;

    class NotificationType extends AbstractType implements ConfiguratorInterface
    {
        /**
         * Must yield RuleInterface
         *
         * @param Context|null $context
         *
         * @return \Generator|RuleInterface|RuleInterface[]
         */
        public function initialize(?Context $context): \Generator
        {
            yield new Rule($context['recipient_email']);
        }

        /**
         * @param OptionsResolver $resolver
         */
        public function configureContext(OptionsResolver $resolver)
        {
            $resolver
                ->setRequired('recipient_email')
                ->setAllowedTypes('recipient_email', 'string');
        }
    }        

On controller:, (*5)

    $this->get('notification.manager')->notifyType(
        new NotificationType(), 
        new Context(['recipient_email' => 'email@gmail.com'])
    );

The Versions

30/03 2017

dev-master

9999999-dev

Symfony bundle for using notification component with user notify functionality

  Sources   Download

MIT

The Requires

 

The Development Requires

by Oleksandr Savchenko

30/03 2017

v0.1.1

0.1.1.0

Symfony bundle for using notification component with user notify functionality

  Sources   Download

MIT

The Requires

 

The Development Requires

by Oleksandr Savchenko

30/03 2017

v0.1

0.1.0.0

Symfony bundle for using notification component with user notify functionality

  Sources   Download

MIT

The Requires

 

The Development Requires

by Oleksandr Savchenko