My Laravel app allows users to modify email templates, then save them to database.
Sample:
Customer {{ $customer_name }} has accepted your proposed timing {{ $timing }} for PO {{ $po_no }}
(User can change 'customer' to 'client' etc.. but leave the {{ }} intact )
The app then loads dynamic data below into above template.
$data = array('customer_email'=> "email@mail.com", 'timing'=> "2pm",'po_no' => "PO001" );
Then email those rendered text to some emails.
How can I do that?
Rephrase:
- load text from db
- make it a Blade template
- render that template with data
I get stuck at #2