Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

parent::registerMarkdownRenderer(); #16

Open
maxlen opened this issue Dec 20, 2019 · 2 comments
Open

parent::registerMarkdownRenderer(); #16

maxlen opened this issue Dec 20, 2019 · 2 comments

Comments

@maxlen
Copy link

maxlen commented Dec 20, 2019

Please add to src/DkimMailServiceProvider.php
row:
parent::registerMarkdownRenderer();

It needs for support themes

@maxlen
Copy link
Author

maxlen commented Dec 20, 2019

`<?php

namespace Vitalybaev\LaravelDkim;

use Illuminate\Mail\MailServiceProvider;

class DkimMailServiceProvider extends MailServiceProvider
{
/**
* Register the service provider.
*
* @return void
*/
public function register()
{
parent::registerSwiftMailer();
parent::registerMarkdownRenderer();

    $this->app->singleton('mailer', function ($app) {
        // Once we have create the mailer instance, we will set a container instance
        // on the mailer. This allows us to resolve mailer classes via containers
        // for maximum testability on said classes instead of passing Closures.
        $mailer = new Mailer(
            $app['view'], $app['swift.mailer'], $app['events']
        );

        $mailer->setQueue(app('queue'));
        
        if (method_exists($this, 'setMailerDependencies')) {
            $this->setMailerDependencies($mailer, $app);
        }

        // If a "from" address is set, we will set it on the mailer so that all mail
        // messages sent by the applications will utilize the same "from" address
        // on each one, which makes the developer's life a lot more convenient.
        $from = $app['config']['mail.from'];

        if (is_array($from) && isset($from['address'])) {
            $mailer->alwaysFrom($from['address'], $from['name']);
        }

        $to = $app['config']['mail.to'];

        if (is_array($to) && isset($to['address'])) {
            $mailer->alwaysTo($to['address'], $to['name']);
        }

        return $mailer;
    });
}

}`

@sanderkruger
Copy link

It's probably a better idea to rename DkimMailServiceProvider's public function register() to protected function registerIlluminateMailer() and drop the call(s) to parent for registering swiftmailer and markdown (wich are then taken care of by the parent's register() method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants