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

Emails are without markup #11

Open
volosan opened this issue Apr 14, 2022 · 2 comments
Open

Emails are without markup #11

volosan opened this issue Apr 14, 2022 · 2 comments

Comments

@volosan
Copy link

volosan commented Apr 14, 2022

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",
...
  1. I've installed npm-package
    package.json
...
"mjml": "^4.12.0",
...
  1. 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
                ]
            );
    }
  1. 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>
  1. Expected result
    image
  2. Real result
    image

My environment:

  • PHP 8.0.15
  • Laravel Framework 8.77.1 (BackPack 4.1)

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
Copy link

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
Copy link

EvanSchleret commented Jul 23, 2024

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

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

No branches or pull requests

3 participants