mercredi 20 juin 2018

Printing mail template from db table

I want to print the mail content from db table in laravel view blade.I have the table mail_template. I want to fetch the field body from that table.

body field is a long text and value is in PHP content

body field value 
<?php

if(($logged==Auth::User()->user_name && $finance_review!='')|| $status=='Rejected'){
?>
<span>Hello ,</span>
<p> has  your Asset
request. Please login to <a href='asd.com'>http://systems.test.com</a>
&rarr; “Asset” and see your status</p>
<?php }
else{ ?>
<span>Hello ,</span>
<p> has raised request. 
Please login to <a href=''>test</a>
&rarr; “Asset” and see your status</p>
<?php } ?>

I want to send the mail with filled content from fetched body field. I have tried as

$mail_content=mail_template::where('config_name','=','approve')->first()->body;
echo $mail_content;

It just prints the content as text. I want to fill the value in variable



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

Aucun commentaire:

Enregistrer un commentaire