vendredi 24 mars 2017

Edit email template in Laravel

I need to edit template which used for emails in admin panel. Any Ideas?

I think about several ways:

  1. Save email template in DB in the text field, edit it in the admin panel and then display the text in the blade's view.

The problem of this way's realization is I have to display php variables in blade template and then use the final code as the html for email. I think, it's so difficult for Laravel.

And the additional problem is if I store in template's text in DB - it will display as the text, blade compiler doesn't process it.

  1. Store only the static text information from email in the DB and then display it in the template. PHP variables will transfer separately.

This way will solve the problem with the php var's display, but I still don't know how to use the final code in the Mail::send, because Laravel allows using the template's name only, not a HTML, as I know...

I think about the following way:

$view = view('template')->render();
mail(..., $view, ...);

But I don't want to use it because I want use Mail::queue() for queuying emails and I don't know how to use it with PHP mail().

Thanks to everybody for replies.



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2nZfYvw
via IFTTT

Aucun commentaire:

Enregistrer un commentaire