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

Shortocodes on email #52

Open
xavicabot opened this issue Feb 6, 2020 · 1 comment
Open

Shortocodes on email #52

xavicabot opened this issue Feb 6, 2020 · 1 comment

Comments

@xavicabot
Copy link

Hi

First of all great package.

I can use it for views, but if i use it for mailing, it takes an error:

Code

return $this->from('[email protected]', 'Sender Name')
            ->subject($this->newsletter->subject)
            ->view($this->newsletter->template->view)->withShortcodes();

Error
ErrorException
Undefined offset: 0

Anyone knows what can i do?

Thanks

@webwizo
Copy link
Owner

webwizo commented Feb 21, 2020

Sorry for delay.

Thank you for your appreciation, sir.

I think Mail class (view) method is different. But maybe you can render a view into variable and pass it to Mail View method.

$view = view($this->newsletter->template->view)->withShortcodes()->render();
// $view = view($this->newsletter->template->view)->render()->withShortcodes();

return $this->from('[email protected]', 'Sender Name')
            ->subject($this->newsletter->subject)
            ->view($view);```

I am not sure, but something like that could work.

Thanks,

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