Created
November 15, 2022 00:06
-
-
Save truongtpa/dca3bec4f946ee7e32eb114c5fe89fa1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Route::post('/send-email', function (Request $request) { | |
| $json = $request->input('data'); | |
| if (ToolsModel::isJson($json)) { | |
| $data = (array)json_decode($request->input('data')); | |
| Mail::send($data['template'], $data, function ($m) use ($data) { | |
| $m->from(env('MAIL_FROM_ADDRESS', null), env('MAIL_FROM_NAME', null)); | |
| $m->to($data['email'])->subject($data['subject']); | |
| }); | |
| return ToolsModel::status(200, "Thực hiện gửi email thành công"); | |
| } | |
| return ToolsModel::status(500, "Dữ liệu không đúng định dạng"); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment