Skip to content

Driver [mailjet] not supported #76

@gcjbr

Description

@gcjbr

I'm trying to use Mailjet as a Laravel driver, meaning I'm trying to avoid invoking it's classes directly.

I did my best to follow the documentation, which is a bit ambivalent on this use, this is what I did:

My .env

MAIL_DRIVER=mailjet
MAILJET_APIKEY=MYKEY
MAILJET_APISECRET=MYSECRET
MAIL_FROM_ADDRESS=MYMAIL
MAIL_FROM_NAME=MYNAME

My services.php return array:


...

    'mailjet' => [
        'key' => env('MAILJET_APIKEY'),
        'secret' => env('MAILJET_APISECRET'),
        'transport' => 'mailjet',   // I tried both with and without this

    ],

...

Added Mailjet\LaravelMailjet\MailjetServiceProvider::class, to my providers array and 'Mailjet' => Mailjet\LaravelMailjet\Facades\Mailjet::class to my aliases.

And here's the class which is triggering the error:


<?php

namespace App\Notifications;

use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Messages\MailMessage;
use Illuminate\Notifications\Notification;

class meuResetDeSenha extends Notification
{
    use Queueable;

    /**
     * Create a new notification instance.
     *
     * @return void
     */
    public function __construct($token)
    {
        $this->token = $token;
    }

    /**
     * Get the notification's delivery channels.
     *
     * @param  mixed  $notifiable
     */
    public function via($notifiable): array
    {
        return ['mailjet'];
    }

    /**
     * Get the mail representation of the notification.
     *
     * @param  mixed  $notifiable
     */
    public function toMail($notifiable): MailMessage
    {
        return (new MailMessage)
            ->subject('Redefina sua senha ')
            ->greeting('Olá!')
            ->line('Você está recebendo este e-mail porque nós recebemos uma requisição para sua conta.')
            ->action('REDEFINIR SENHA', route('password.reset', $this->token))
            ->line('Se você não requisitou uma redefinição de senha, nenhuma ação é necessária.')
            ->markdown('vendor.notifications.email');
    }

    /**
     * Get the array representation of the notification.
     *
     * @param  mixed  $notifiable
     */
    public function toArray($notifiable): array
    {
        return [
            //
        ];
    }
}


I can't use the solution here #58 since MailjetMailServiceProvider::class no longer exists.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions