escuelademusica / laravel-mjml

MJML Driver for Laravel Emails and Notification.
MIT License
5 stars 2 forks source link

Emails are without markup #11

Open volosan opened 2 years ago

volosan commented 2 years ago

Hello! I want to use your package but stuck with problem: my emails are without markup.

My steps:

  1. I've installed your package composer.json
    ...
    "escuelademusica/laravel-mjml": "^0.1.2",
    ...
  2. I've installed npm-package package.json
    ...
    "mjml": "^4.12.0",
    ...
  3. My Mailable class app/Mail/ClientBookingMail.php
    use EscuelaDeMusica\MJML\Mail\Mailable;
    ...
    public function build()
    {
        return $this->from(env('MAIL_FROM_ADDRESS'), env('MAIL_FROM_NAME'))
            ->subject('Booking mail')
            ->mjml('mail.bookings.mjml.client', [
                    'booking'               => $this->booking,
                    'responsibilityPerson'  => $this->responsibilityPerson,
                    'mailRecipientType'     => Booking::BOOKING_MAIL_RECIPIENT_CLIENT
                ]
            );
    }
  4. For view I've used very simple mjml-example resources/views/mail/bookings/mjml/client.blade.php
    <mjml>
    <mj-body>
    <mj-section>
      <mj-column>
        <mj-image width="200px" src="https://d1csarkz8obe9u.cloudfront.net/posterpreviews/geometric-black-white-red-logo-design-template-c277787c3b994fb7a3063e13c6848447_screen.jpg"></mj-image>
        <mj-divider border-color="#F45E43"></mj-divider>
        <mj-text font-size="20px" color="#F45E43" font-family="helvetica">Hello World</mj-text>
      </mj-column>
    </mj-section>
    </mj-body>
    </mjml>
  5. Expected result image
  6. Real result image

My environment:

What did I set up wrong?

P.S. Additionally I set the setting in the .env-file but the result is the same

MJML_BINARY_PATH=/var/www/resources/views/mail/bookings/mjml
kirkbushell commented 2 years ago

Yeah, I'm having this excat problem - on laravel 9, so seems it's more widespread. Basically, it doesn't work as it's not executing the mjml binary to convert the markup to html and css. In fact, half the methods in the code are never utilised.

EvanSchleret commented 3 months ago

Given the last update of this repo, I would like to refer you to the package I made yesterday, which allows the use of MJML, if you are still looking for a functional solution : https://github.com/EvanSchleret/lara-mjml