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

Undefined variable $abc #157

Open
eaponiente opened this issue Feb 10, 2023 · 2 comments
Open

Undefined variable $abc #157

eaponiente opened this issue Feb 10, 2023 · 2 comments

Comments

@eaponiente
Copy link

When I pass a variable to the view content I get this issue

public function content()
    {
        return new Content(
            view: $this->mjml('test')->buildMjmlView()['html'],
            with: [
                'abc' => 'Dummy Sentence'
            ]
        );
    }
@olivermbs
Copy link

I have the same problem, any ideas?

@marin-yxz
Copy link

Maybe it's been solved but for future notice I use it like this

    public function content()
    {
        return new Content(
            view: $this->mjml('emails.reservation',
                [
                    'name' => 'John Doe',
                    'price' => '1000'
                ])
                ->buildMjmlView()['html'],
        );

    }

and the view

<mjml>
    <mj-body >
        <mj-column>
            <mj-text>{{$name}}</mj-text>
            <mj-text>{{$price}}</mj-text>
        </mj-column>
    </mj-body>
</mjml>

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

3 participants