dachcom-digital / pimcore-members

Pimcore Object, Asset and Document Restriction & Frontend Authentication
Other
54 stars 34 forks source link

Use Interface for Mailer so that the Mailer-Implementation gets replaceable in the Container #108

Closed dasraab closed 5 years ago

dasraab commented 5 years ago
Q A
New feature? yes
BC breaks? no
Deprecations? no
Fixed tickets #107

With this change we´re able to replace the Mailer-Implementation for transactional mails with our own implementation.

Just bind your own service the the interface

services:

    _defaults:
        autowire: true
        autoconfigure: true
        public: true

    MembersBundle\Mailer\MailerInterface: '@AppBundle\Mailer\Mailer'

our service has to implement the MailerInterface

<?php
use MembersBundle\Mailer\MailerInterface;

class Mailer implements MailerInterface
{
  // add your implementation
}
?>