2017 © Pedro Peláez
 

symfony-bundle email-engine

Email engine for Symfony

image

sfcod/email-engine

Email engine for Symfony

  • Wednesday, June 20, 2018
  • by lexxorlov
  • Repository
  • 1 Watchers
  • 7 Stars
  • 560 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 11 Versions
  • 56 % Grown

The README.md

Symfony Email Engine Bundle

Scrutinizer Code QualityCode Climate, (*1)

Provides possibility to send parametrized emails with attachments using queue of senders+repositories combination., (*2)

Config:

sfcod_email_engine:
    main_sender: chained_sender
    senders:
        chained_sender:
            chain:
                senders: [db_swiftmailer_sender, twig_file_swiftmailer_sender]
        twig_file_swiftmailer_sender:
            sender:
                class: SfCod\EmailEngineBundle\Sender\SwiftMailerSender
            repository:
                class: SfCod\EmailEngineBundle\Repository\TwigFileRepository
        db_swiftmailer_sender:
            sender:
                class: SfCod\EmailEngineBundle\Sender\SwiftMailerSender
            repository:
                class: SfCod\EmailEngineBundle\Repository\DbRepository
                arguments: { entity: <entity_class>, attribute: slug }
    templates:
        - SfCod\EmailEngineBundle\Example\TestTemplate

Where "templates" section needed for "SfCod\EmailEngineBundle\Mailer\TemplateManager" service and for params autowiring/autoconfiguring as services. Using which you can get all possible email template parameters, description, etc., (*3)

And implements SfCod\EmailEngineBundle\Entity\EmailEntityInterface, (*4)

Usage:

use SfCod\EmailEngineBundle\Mailer\Mailer;
use SfCod\EmailEngineBundle\Example\TestOptions;
use SfCod\EmailEngineBundle\Example\TestTemplate;

public function indexAction(Mailer $mailer) {
    $options = new TestOptions('some message', 'attachment_path');
    $template = new TestTemplate($options);
    $mailer->send($template, 'example@email.com');
}

If you want to use SfCod\EmailEngineBundle\Sender\SwiftMailerSender with SfCod\EmailEngineBundle\Repository\TwigFileRepository then you have to implement SfCod\EmailEngineBundle\Template\TwigTemplateAwareInterface., (*5)

And TestTemplate email will be sent using SwiftMailerSender and template data will be collected from DbRepository. If it fails, will be used SwiftMailerSender+TwigFileRepository, because both of them listed in "chained_sender" (see config section)., (*6)

The Versions

18/06 2018

dev-remove-container

dev-remove-container

Email engine for Symfony

  Sources   Download

MIT

The Requires

 

The Development Requires

by Orlov Aleksey

13/03 2018

dev-template-manager-simplify

dev-template-manager-simplify

Email engine for Symfony

  Sources   Download

MIT

The Requires

 

The Development Requires

by Orlov Aleksey

21/02 2018

1.0.0

1.0.0.0

Email engine for Symfony

  Sources   Download

MIT

The Requires

 

The Development Requires

by Orlov Aleksey