zenmail/zen-mail

ZenMail, admin send email

Installs: 3

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

Type:symfony-bundle

dev-master / 0.1.x-dev 2015-02-12 23:18 UTC

This package is auto-updated.

Last update: 2024-11-29 04:14:22 UTC


README

Scrutinizer Code Quality Build Status Code Coverage Build Status

  • Instalación Implementar interface a tu clase usuario ZenMail\ZenCoreBundle\Adapter\Interfaces\ZenUserInterface
  • Configuración En config.yml:
    parameters:
        #Si usas otro sistema de correo aquí deberas cambiar por el que te diga ese bundle.
        zen_mailer_adapter: zen_swift_mailer_adapter
  • Eventos Servicios: Para los eventos pre y post send debes crear un listener pare ello
       
        use ZenMail\ZenCoreBundle\Event\ZenPreSendMailEvent;
        use ZenMail\ZenCoreBundle\Event\ZenPostSendMailEvent;
    
        class ZenMail {
    
            /**
             * @param ZenPreSendMailEvent $zenPreSendMailEvent
             */
            public function onZenPreSendMail(ZenPreSendMailEvent $zenPreSendMailEvent)
            {
                /*
                * Your code for this event
                */
            }
    
            /**
             * @param ZenPostSendMailEvent $zenPostSendMailEvent
             */
            public function onZenPostSendMail(ZenPostSendMailEvent $zenPostSendMailEvent){
                 /*
                 * Your code for this event
                 */
            }
        }
        zen_mail.send:
            class: AppBundle\EventListener\ZenMail
            tags:
               - { name: kernel.event_listener, event: zen.pre.send.mail, method: onZenPreSendMail }
               - { name: kernel.event_listener, event: zen.post.send.mail, method: onZenPostSendMail }
  • Adapters Si vas a crear un adapter deberás crear dos:
    • Mailer: En este se adapta el envio de Zen Mail con el tuyo, para eso tienes implementar 'ZenMail\ZenCoreBundle\Adapter\Interfaces\ZenMailerInterface'
    • Message: En este se adapta el mensaje que se enviará con el de Zen Mail, para ello tienes que implementar 'ZenMail\ZenCoreBundle\Adapter\Interfaces\ZenMessageInterface'