本文整理汇总了PHP中Illuminate\Support\Facades\Mail::to方法的典型用法代码示例。如果您正苦于以下问题:PHP Mail::to方法的具体用法?PHP Mail::to怎么用?PHP Mail::to使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Support\Facades\Mail
的用法示例。
在下文中一共展示了Mail::to方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: register
/**
* Handle a registration request for the application.
*
* @param \Illuminate\Http\Request $request
*
* @return \Illuminate\Http\Response
*/
public function register(Request $request)
{
$this->validator($request->all())->validate();
$user = $this->create($request->all());
$this->guard()->login($user);
Mail::to($user->email)->send(new NewUserMail($user));
return redirect($this->redirectPath());
}
示例2: register
public function register(Request $request)
{
$this->validator($request->all())->validate();
$user = $this->create($request->all());
$token = $this->createToken($user);
Mail::to($user)->send(new ActivationMail($token));
return redirect()->back()->withSuccess(trans('auth::auth.registration_success'));
}
示例3: updateStatus
public function updateStatus($id, UpdateOrderStatusRequest $request)
{
$order = Order::findorfail($id);
$order->update($request->all());
$userEmail = $order->user->email;
$orderStatusTitle = $order->order_status_title;
Mail::to($userEmail)->send(new UpdateOrderStatusMail($orderStatusTitle));
return redirect()->route('admin.order.index');
}
示例4: postContactUs
public function postContactUs(ContactUsRequest $request)
{
if (Auth::check()) {
$user = Auth::user();
}
$request->merge(['full_name' => $user->full_name, 'email' => $user->email]);
Mail::to($user->email)->send(new ContactUsMail($request->all()));
return redirect()->back();
}
示例5: sendEmailInvoice
public function sendEmailInvoice($id)
{
$order = Order::findorfail($id);
$user = User::find($order->user_id);
$view = view('order.pdf')->with('order', $order);
$path = public_path('/uploads/order/invoice/' . $order->id . '.pdf');
PDF::loadHTML($view->render())->save($path);
Mail::to($user->email)->send(new OrderInvoicedMail($order, $path));
//Mail::send();
//dd($view->render());die;
//PDF::loadHTML($view->render())->save('my_stored_file.pdf')->stream('download.pdf');
//return redirect()->back();
}
示例6: store
/**
* Store the specified resource.
*
* @param CreateAccount $request
* @return Response
*/
public function store(CreateAccount $request)
{
// save to db
$roles = $request->get('roles', []);
$user = $this->repository->createByAdmin($request->only('name', 'email', 'password', 'status', 'must_change_password'), $roles);
$password = $request->get('password');
// send account info to email
if ($request->has('send_account_information')) {
Mail::to($user)->send(new AccountInformation($user, $password));
//Mail::send('emails.account_information', compact('user', 'password'), function($message) use ($user) {
// $message->subject('Your Account Information');
// $message->to($user->email);
//});
}
return redirect()->route('epicentrum::users.index')->withSuccess(trans('epicentrum::message.user_created'));
}
示例7: send
public function send(Request $req)
{
Mail::to($req->get('to'))->send(new TestEmail());
return $req->get('to');
}
示例8: sendEmails
private function sendEmails(Booking $booking)
{
// objects from place
if (isset($booking->place_id_225)) {
$result = collect(config('booking.models'))->where('id', $booking->place_id_225);
if (count($result) === 0) {
return response()->json(['status' => 'error', 'code' => 404, 'message' => 'Records not found']);
}
// model constructor
$model = App::make($result->first()->model);
// use sofa to get lang from lang table of object query
$establishment = $model->builder()->where('lang_id', base_lang()->id_001)->where('id', $booking->object_id_225)->first();
$attachment = Attachment::builder()->where('lang_id_016', base_lang()->id_001)->where('resource_id_016', 'hotels-hotel')->where('object_id_016', $establishment->id)->where('family_id_016', 1)->orderBy('sorting', 'asc')->first();
//****************************
// get values to Master Card
//****************************
$customFields = CustomField::where('group_id_026', 4)->get();
if (isset($customFields) && $customFields->where('name_026', 'master_card_feature')->count() > 0) {
$masterCardFeatures = $customFields->where('name_026', 'master_card_feature')->first()->getResults()->where('object_id_028', $establishment->id_170)->where('lang_id_028', 'es')->get()->first();
} else {
$masterCardFeatures = null;
}
// get vouchers
$vouchers = Voucher::builder()->whereIn('id_226', json_decode($booking->data_225))->get();
// status confirmed
if ($booking->status_225 == 1) {
Mail::to('cpalacin@syscover.com')->bcc('info@syscover.com')->cc('cristina@ruralka.com')->send(new BookingEmail('booking::emails.customer_booking_notification', trans('booking::pulsar.subject_customer_booking_email', ['bookingId' => $booking->id_225 . '/' . date('Y')]), $booking, $establishment, $vouchers, $attachment, $masterCardFeatures));
Mail::to('cpalacin@syscover.com')->bcc('info@syscover.com')->cc('cristina@ruralka.com')->send(new BookingEmail('booking::emails.hotel_booking_notification', trans('booking::pulsar.subject_hotel_booking_email', ['bookingId' => $booking->id_225 . '/' . date('Y')]), $booking, $establishment, $vouchers, $attachment, $masterCardFeatures));
} elseif ($booking->status_225 == 3) {
Mail::to('cpalacin@syscover.com')->bcc('info@syscover.com')->cc('cristina@ruralka.com')->send(new BookingEmail('booking::emails.customer_cancel_booking_notification', trans('booking::pulsar.subject_customer_cancel_booking_email', ['bookingId' => $booking->id_225 . '/' . date('Y')]), $booking, $establishment, $vouchers, $attachment, $masterCardFeatures));
Mail::to('cpalacin@syscover.com')->bcc('info@syscover.com')->cc('cristina@ruralka.com')->send(new BookingEmail('booking::emails.hotel_cancel_booking_notification', trans('booking::pulsar.subject_hotel_cancel_booking_email', ['bookingId' => $booking->id_225 . '/' . date('Y')]), $booking, $establishment, $vouchers, $attachment, $masterCardFeatures));
}
}
}
示例9: sendResetPasswordToken
/**
* Send a password reset token e-mail to the specified address
*
* @param Request $request
*/
public function sendResetPasswordToken(Request $request)
{
$rules = ['email' => 'required|email|exists:users'];
$validator = Validator::make($request->only('email'), $rules);
if ($validator->fails()) {
throw new ValidationHttpException($validator->errors());
}
$user = User::where('email', $request->input('email'))->get()->first();
$token = new LoginToken();
$token->user_id = $user->id;
$token->token = str_random(63);
$token->expires_at = Carbon::now()->addHours(72);
$token->save();
Mail::to($user->email)->send(new ResetPassword($user, $token));
}