{"repo":"spatie/laravel-database-mail-templates","free":true,"listed":false,"github":"https://github.com/spatie/laravel-database-mail-templates","clone":"git clone https://github.com/spatie/laravel-database-mail-templates.git","description":"Render Laravel mailables based on a mail template stored in the database","language":"PHP","stars":446,"topics":["php","laravel","mailable","customize","template"],"license":"MIT","category":"databases-storage","readme_excerpt":"Render Laravel mailables based on a mail template stored in the database Render Laravel mailables using a template stored in the database. Support us We invest a lot of resources into creating best in class open source packages. You can support us by buying one of our paid products. We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on our contact page. We publish all received postcards on our virtual postcard wall. Quick example The following example will send a WelcomeMail using a template stored in the database and wrapped in an HTML layout. The HTML for the sent email will look like this: Installation You can install the package via composer: Publish and run the database migrations: If you want to use the default MailTemplate model, all that's left to do is run php artisan migrate to create the mail templates table. If you plan on creating a custom MailTemplate model continue by modifying the migration and creating your custom model before running php artisan migrate . Usage After installing the package and running the migrations you'll have a new table in your database called mail templates . This table will be used by the MailTemplate model. The default MailTemplate has a mailable property that corresponds to the Mailable 's class name. It also has a subject and body property which are both used to store mustache template strings. You might want to set up a seeder that seeds your a","default_branch":null,"files":null,"tree":[],"storefront":"/r/spatie","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/spatie/laravel-database-mail-templates/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}