base64形式のデータを受け取った場合、添付された画像を電子メールで送信するにはどうすればよいですか?ここでLaravel display base64 image
は、メールテンプレートです:
<h1>You got mail from - {{$user->name}}</h1>
<h2>Date:</h2>
<p>{{$post->created_at}}</p>
<h2>Message:</h2>
<p>{{$post->body}}</p>
<img src="data:image/png;base64, {{$image}}">
<div>
</div>
とロジック:このことから
public function createPost()
{
$user = JWTAuth::toUser();
$user->posts()->create(['user_id' => $user->id, 'body' => Input::get('comment.body')]);
Mail::send('mail.template', [
'image' => Input::get('image'),
'user' => $user,
'post' => Post::where('user_id', $user->id)->get()->last(),
], function ($m) use ($user) {
$m->from('[email protected]', 'XYZ');
$m->to('[email protected]', $user->name)->subject('Subject');
});
}
私は唯一のフルbase64文字列でメールを取得... img
タグが
Input :: get( 'image') '' 'はbase64イメージを含んでいますか? – Viktor
はい。私はそれをhttp://codebeautify.org/base64-to-image-converterに貼り付けて、私に画像を表示します – Norgul
私は答えを更新しました。 – Viktor