public function send(Collection $data) { $validator = $this->validator($data->toArray(), $this->type); if (!$validator->fails()) { Mailer::send("emails.{$this->type}", $data->toArray(), function ($message) use($data) { $fromAddress = $data->get('from_address'); $fromName = $data->get('from_name'); $toAddress = $data->get('to_address'); $toName = $data->get('to_name'); $cc = $data->get('cc[]', []); $bcc = $data->get('bcc[]', []); // Send the message $message->from($fromAddress, $fromName); $message->to($toAddress, $toName)->subject($data->get('subject')); foreach ($cc as $address) { $message->cc($address, null); } foreach ($bcc as $address) { $message->bcc($address, null); } }); } else { // Validation failed return ['success' => 0, 'status' => "Failed to validate message", 'messages' => $validator->getMessageBag()->all(), 'data' => $data, 'type' => $this->type]; } if (!count(Mailer::failures())) { $this->sent_at = Carbon::now(); Log::info("Sent {$this->type} email"); return ['success' => 1, 'status' => "successfully sent message", 'data' => $data, 'type' => $this->type]; } Log::info("Failed to send {$this->type} email"); return ['success' => 0, 'status' => "failed to send message", 'messages' => "failed to send message", 'data' => $data, 'type' => $this->type]; }
/** * Execute the console command. * * @return mixed */ public function handle() { $name = $this->argument('name'); $email = $this->argument('email'); $subject = $this->option('subject'); $token = $this->option('token'); $caption = $this->option('caption'); $fullUrl = $this->option('fullUrl'); $headers = $this->option('headers'); $parentClass = $this->option('parentClass'); $exceptionTrace = $this->option('exceptionTrace'); if (is_null($token)) { Mail::send('emails.' . $this->argument('type') . '', ['name' => $name, 'email' => $email, 'subject' => $subject], function ($mail) use($name, $email, $subject) { $mail->subject($subject); $mail->to($email, $name); }); } else { switch ($this->argument('type')) { case "exception": Mail::send('emails.' . $this->argument('type') . '', ['name' => $name, 'email' => $email, 'subject' => $subject, 'caption' => $caption, 'fullUrl' => $fullUrl, 'headers' => $headers, 'parentClass' => $parentClass, 'exceptionTrace' => $exceptionTrace], function ($mail) use($name, $email, $subject, $caption, $fullUrl, $headers, $parentClass, $exceptionTrace) { $mail->subject($subject); $mail->to($email, $name); }); break; default: Mail::send('emails.' . $this->argument('type') . '', ['name' => $name, 'email' => $email, 'token' => $token, 'subject' => $subject], function ($mail) use($name, $email, $subject, $token) { $mail->subject($subject); $mail->to($email, $name); }); } } }
/** * setting methods */ public function setStatus($status) { $user = $this->getUser(); switch ($status) { case 'pending': $this->decline_date = null; $this->accept_date = null; $this->save(); $user->owner_flag = 0; break; case 'denied': $this->decline_date = gmdate('Y-m-d H:i:s'); $this->accept_date = null; $this->save(); Mail::send('emails.ownership-denied', array('user' => $user), function ($message) { $message->to($this->getUser()->email, $this->getUser()->getFullName()); $message->subject('SWAMP Owner Application Denied'); }); $user->owner_flag = 0; break; case 'approved': $this->accept_date = gmdate('Y-m-d H:i:s'); $this->decline_date = null; $this->save(); Mail::send('emails.ownership-approved', array('user' => $user), function ($message) { $message->to($this->getUser()->email, $this->getUser()->getFullName()); $message->subject('SWAMP Owner Application Approved'); }); $user->owner_flag = 1; break; } }
public function getCreate(Request $request) { header("Access-Control-Allow-Origin: *"); header("Allow: GET, POST, OPTIONS"); $error = false; $msg = ""; try { $nombre = $request->input('nombre'); $dni = $request->input('dni'); $email = $request->input('email'); $password = $request->input('password'); $telefono = $request->input('telefono'); $dominio = $request->input('dominio'); if (User::whereRaw('email=?', [$email])->count() > 0) { $user = null; $error = true; $msg = "Este correo ya ha sido registrado"; } else { $user = User::create(['name' => $nombre, "dni" => $dni, 'email' => $email, "password" => $password, "telefono" => $telefono]); $user->codigo = $user->id . date("i") . date("d"); $user->save(); $data = array('url' => $dominio . "/confirmar?mail=" . $user->email . "&confirmar=" . $user->codigo); Mail::send('mails.confirmacion', $data, function ($message) use($user) { $message->to($user->email)->subject('Confirmar registro'); }); $msg = "Se envio un correo de confirmmacion a su cuenta de correo"; } } catch (\Exception $e) { $user = null; $error = true; $msg = $e->getMessage(); } return ["user" => $user, "error" => $error, "msg" => $msg]; }
public function sendEnquireMail() { $name = Input::get('name'); $email = Input::get('email'); $mobile = Input::get('mobile'); $message2 = Input::get('message'); $result = array(); $validation = $validator = Validator::make(array('Name' => $name, 'email' => $email, 'Mobile' => $mobile, 'Message' => $message2), array('Name' => 'required', 'email' => 'required|email', 'Mobile' => 'required|numeric', 'Message' => 'required')); if ($validation->fails()) { $result['status'] = 'Failure'; $result['message'] = 'Fill all fields with valid values'; return response()->json($result); } $data['name'] = $name; $data['email'] = $email; $data['mobile'] = $mobile; $data['message2'] = $message2; Mail::send('mail.enquire', $data, function ($message1) use($data) { $message1->from($data['email'], $data['name']); $message1->to('*****@*****.**', 'Enquiry - Oxoniya')->subject('Enquiry - Oxoniya'); }); $result['status'] = 'Success'; $result['message'] = 'Contact Form Successfully Submitted'; return response()->json($result); }
/** * sendEmail : Sends received email to target * * @return array : asociative array with the final status of request */ public function sendEmail() { // Recovers mail data object $mailData = json_decode(Input::get('emailData')); //Defines validator object $validator = Validator::make((array) $mailData, ['email' => array('required', 'regex:/^((<[a-z]+>)?[\\.a-zA-ZáéíóúÁÉÍÓÚñÑ_1-9]+@[a-zA-ZáéíóúÁÉÍÓÚñÑ_-]+\\.[a-zA-ZáéíóúÁÉÍÓÚñÑ]{2,12})(,((<[a-z]+>)?[\\.a-zA-ZáéíóúÁÉÍÓÚñÑ_1-9]+@[a-zA-ZáéíóúÁÉÍÓÚñÑ_-]+\\.[a-zA-ZáéíóúÁÉÍÓÚñÑ]{2,12}))*$/'), 'subject' => array('required', 'regex:/^[a-zA-ZáéíóúÁÉÍÓÚñÑ1-9][a-zA-ZáéíóúÁÉÍÓÚñÑ1-9 ]{3,50}$/')]); // Returns fail message if validation fails if ($validator->fails()) { return response()->json(['status' => 'fail'], 200); } else { // Split string of emails into an array of emails $allMails = explode(',', $mailData->email); // For each mail in $allMails, actual name and target of each mail are getted, and then the email is sent foreach ($allMails as $mail) { $separatorPosition = strpos($mail, '>'); if ($separatorPosition) { $name = substr($mail, 1, $separatorPosition - 1); $target = substr($mail, $separatorPosition + 1); } else { $target = $mail; $name = ''; } Mail::send([], [], function ($message) use($mailData, $target, $name) { $message->to($target, $name); $message->subject($mailData->subject); $message->setBody($mailData->htmlContent, 'text/html'); }); } return response()->json(['status' => 'success'], 200); } }
public function sendContactForm() { $is_mail_sent = false; // Get data $lastname = post('lastname'); $firstname = post('firstname'); $email = post('email'); $subject = post('subject'); $message_body = post('message'); $inputs = ['lastname' => $lastname, 'firstname' => $firstname, 'email' => $email, 'subject' => $subject, 'message' => $message_body]; $rules = ['lastname' => 'required', 'firstname' => 'required', 'email' => 'required|email', 'subject' => 'required', 'message' => 'required']; $messages = ['lastname.required' => 'contactForm.lastname_required', 'firstname.required' => 'contactForm.firstname_required', 'email.required' => 'contactForm.email_required', 'email.email' => 'contactForm.email_invalid', 'subject.required' => 'contactForm.subject_required', 'message.required' => 'contactForm.message_required']; // Data Validation $validator = Validator::make($inputs, $rules, $messages); if ($validator->fails()) { $messages = $validator->messages(); $this->page["inputs"] = $inputs; $this->page["messages"] = $messages; return; } $data = compact('firstname', 'lastname', 'email', 'subject', 'message_body'); $is_mail_sent = Mail::send('algad.bootstrap::mail.contactform.message', $data, function ($message) use($firstname, $lastname, $email) { $message->from($email, $firstname . " " . $lastname); $message->addReplyTo($email, $lastname . ' ' . $firstname); $message->to($this->getProperty('recipient_email')); }); if ($is_mail_sent) { $this->page["contact_success_message"] = $this->getProperty('email_sent_confirmation'); } else { $this->page["contact_error_message"] = $this->getProperty('email_sent_failed'); } }
/** * @param Request $request * @return \Illuminate\Http\RedirectResponse */ public function post(Request $request) { $data['title'] = $request->bugTitle; $data['description'] = $request->bugDescription; $data['controller'] = $request->controller; if (!Auth::user()) { $data['email'] = $request->bugEmail; $data['name'] = $request->bugName; $validator = Validator::make($request->all(), ['bugEmail' => 'required|email|max:255', 'bugName' => 'required|max:255|alpha_space', 'bugTitle' => 'required|max:255', 'bugDescription' => 'required|max:255']); } else { $data['email'] = Auth::user()->email; $data['name'] = Auth::user()->name; $validator = Validator::make($request->all(), ['bugTitle' => 'required|max:255|email', 'bugDescription' => 'required|max:255']); } if ($validator->fails()) { return back()->withErrors($validator)->withInput()->with('modal', true); } $response = Mail::send('emails.ladybug', $data, function ($message) use($data) { $message->from($data['email'], $data['name']); $message->subject("Bug Report"); $message->to('*****@*****.**'); }); if ($response) { return back()->with('success', 'Your report has been sent.'); } else { return back()->with('error', 'An error occured, please try again.'); } }
/** * Send an e-mail reminder to the user. * * @param Request $request * @param int $id * @return Response */ public function sendEmailContact(Request $request) { //return response()->json($request->all()); $test = $this->validate($request, ['name' => 'required|max:255', 'email' => 'required|email', 'phone' => 'required|digits:10', 'message' => 'required']); /* _token: "b0cehzEEK2fbzXilKcI9CiijhEClyBIXkvTpPCze", name: "Tonny Wijnand", email: "*****@*****.**", phone: "0615061892", message: "TEST" */ //return $test; /* if ($this->validator->fails()) { return redirect('post/create') ->withErrors($validator) ->withInput(); } */ //dc($request->all()); $user = (object) ['from' => '*****@*****.**', 'fromName' => 'Pyxis Projeckmanagement', 'to' => '*****@*****.**', 'toName' => 'Tonny Wijnand', 'subject' => 'Contact formulier via website pyxis']; $test = Mail::send(['emails.contact-form', 'emails.contact-form-text'], ['user' => $user], function ($m) use($user) { //$m->from('*****@*****.**', 'Your Application'); //$m->to($user->email, $user->name)->subject('Your Reminder!'); $m->from($user->from, $user->fromName); $m->to($user->to, $user->toName)->subject($user->subject); }); $data = ['status' => 'success', 'statusText' => 'Update is gelukt', 'responseText' => 'De volgorde is aangepast', 'mail' => $test]; return response()->json($data); }
public function sendquotation() { $input = Input::all(); $name = $input['name']; $email_client = $input['email']; $phone_client = $input['phone']; $title = $input['title']; $msg_webneoo = nl2br($input['msg_webneoo']); Mail::send('emails.quotation', ['name' => $name, 'email_client' => $email_client, 'phone_client' => $phone_client, 'msg_webneoo' => $msg_webneoo], function ($m) use($email_client, $title) { $m->from($email_client, 'Webneoo')->subject($title); $m->to('*****@*****.**'); }); /*Mail::send('emails.contact', array('name' => $name, 'email_client' => $email_client, 'subject_client' => $subject_client, 'msg_webneoo' => $msg_webneoo), function($message) use ($email_client) { $message->from($email_client, 'Webneoo')->subject('From Webneoo Website'); $message->to('*****@*****.**'); });*/ /*Mail::send('emails.quotation', array('name' => $name, 'email_client' => $email_client, 'subject_client' => $subject_client, 'msg_webneoo' => $msg_webneoo), function($message) use ($email_client, $title) { $message->from($email_client, 'Webneoo')->subject($title); $message->to('*****@*****.**'); });*/ return View::make('pricing.index'); }
/** * Send email notifications from the action owner to other involved users * @param string $template * @param array $data * @param object $ticket * @param object $notification_owner */ public function sendNotification($template, $data, $ticket, $notification_owner, $subject, $type) { if (config('ticketit.queue_emails') == 'yes') { Mail::queue($template, $data, function ($m) use($ticket, $notification_owner, $subject, $type) { if ($type != 'agent') { if ($ticket->user->email != $notification_owner->email) { $m->to($ticket->user->email, $ticket->user->name); } if ($ticket->agent->email != $notification_owner->email) { $m->to($ticket->agent->email, $ticket->agent->name); } } else { $m->to($ticket->agent->email, $ticket->agent->name); } $m->from($notification_owner->email, $notification_owner->name); $m->subject($subject); }); } else { Mail::send($template, $data, function ($m) use($ticket, $notification_owner, $subject, $type) { if ($type != 'agent') { if ($ticket->user->email != $notification_owner->email) { $m->to($ticket->user->email, $ticket->user->name); } if ($ticket->agent->email != $notification_owner->email) { $m->to($ticket->agent->email, $ticket->agent->name); } } else { $m->to($ticket->agent->email, $ticket->agent->name); } $m->from($notification_owner->email, $notification_owner->name); $m->subject($subject); }); } }
public function send() { if ($this->to && $this->body && $this->subject) { $data = array("body" => $this->body); //save in logs $this->doAddMailer(); Mail::send('mail-templates::email_body', $data, function ($message) { if (strpos($this->to, ",")) { $toArray = explode(",", $this->to); foreach ($toArray as $email) { $email = trim($email); $message->to($email)->subject($this->subject); } } else { $message->to($this->to)->subject($this->subject); } //if isset attach file if ($this->attach) { if (is_array($this->attach)) { foreach ($this->attach as $attach) { $message->attach($attach->getRealPath(), array('as' => $attach->getClientOriginalName(), 'mime' => $attach->getMimeType())); } } else { $message->attach($this->attach->getRealPath(), array('as' => $this->attach->getClientOriginalName(), 'mime' => $this->attach->getMimeType())); } } }); return true; } else { return false; } }
/** * iLife iOS Backend API No.2 * @param Request $request * @return string */ public function userSignUp(Request $request) { // Check whether this user exist $user = User::where('email', '=', $request->email)->get(); if (sizeof($user) == 1) { $result = array('code' => 3, 'message' => 'Cannot signup, email has been registered', 'data' => null); return json_encode($result); } // If user does not exists, register a new user $new_user = new User(); $new_user->name = $request->name; $new_user->email = $request->email; $new_user->password = bcrypt($request->password); $new_user->save(); // Send user an email after successfully registration $user_data['name'] = $request->name; $data['email'] = $request->email; Mail::send('email_reply/register_reply', $user_data, function ($message) use($data) { $message->from('*****@*****.**', "iLife"); $message->subject("Welcome to iLife"); $message->to($data['email']); }); $result = array('code' => 1000, 'message' => 'Sign up succeed', 'data' => $new_user->id); return json_encode($result); }
public function sendConfirmationEmail($user) { return Mail::send('emails.users.rsvp-confirm', ['user' => $user], function ($m) use($user) { $m->to($user->email, $user->name)->subject('Camp Schwartzelrod is 6 weeks away!'); //$m->to('*****@*****.**', $user->name)->subject('Camp Schwartzelrod is 6 weeks away!'); }); }
/** * Send balin invitation * * @param user, store * @return JSend Response */ public function invitation() { $user = Input::get('user'); $email = Input::get('email'); $store = Input::get('store'); // checking user data if (empty($user)) { throw new Exception('Sent variable must be array of a record.'); } // checking email data if (empty($email) || !is_array($email)) { throw new Exception('Sent variable must be array of a record.'); } // checking store data if (empty($store)) { throw new Exception('Sent variable must be array of a record.'); } $data = ['user' => $user, 'balin' => $store]; foreach ($email as $key => $value) { //send mail Mail::send('mail.' . $this->template . '.account.invitation', ['data' => $data], function ($message) use($user, $value) { $message->to($value['email'], $value['email'])->subject(strtoupper($this->template) . ' INVITATION FROM ' . strtoupper($user['name'])); }); } return new JSend('success', (array) Input::all()); }
/** * Handle the event. * * @param SomeEvent $event * @return void */ public function handle(OrderWasCreatedEvent $event) { Mail::send('emails.order', ['order' => $event->order], function ($message) { $message->from('*****@*****.**'); $message->to(Memory::get('site.email_to', '*****@*****.**'))->subject('Заказ с сайта kadsgroup.com.ua'); }); }
/** * Execute the job. * * @param Mailer $mailer * @return void */ public function handle(Mailer $mailer) { $user = $this->user; Mail::send('email.registration', array('name' => $user->name, 'link' => $user->confirmation_code), function ($message) use($user) { $message->to($user->email, $user->name)->subject('Confirmation Email'); }); }
/** * Handle the event. * * @param CheckoutEvent $event * @return void */ public function handle(CheckoutEvent $event) { /* * public function sendEmailReminder(Request $request, $id) { $user = User::findOrFail($id); Mail::send('emails.reminder', ['user' => $user], function ($m) use ($user) { $m->from('*****@*****.**', 'Your Application'); $m->to($user->email, [=´çpoktfçfgnf '$user->name)->subject('Your Reminder!'); }); }kkkkmolpkiolo.; [ */ $user = $event->getUser(); $order = $event->getOrder(); Mail::send('emails.checkout', compact('user', 'order'), function ($message) use($order, $user) { $message->from('*****@*****.**', 'Code Commerce'); $message->to($user->email, $user->name); $message->subject('Code Commerce | Seu Pedido'); }); }
/** * Display the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function buyout(Request $request) { $this->validate($request, ['id' => 'required']); $data = $request->all(); $auction = Auction::where('id', $data['id'])->first(); $locale = App::getLocale(); $newest = Auction::translatedIn($locale)->where('end_date', '>=', Carbon::now())->orderBy('created_at', 'DESC')->first(); /* * if active auction */ if ($auction->end_date < Carbon::now()) { return Redirect::back()->withErrors([' This auction is expired']); } elseif ($auction->status_id != 1) { return Redirect::back()->withErrors([' This auction is not active']); } else { $auction->status_id = 4; $auction->save(); $bids = App\Bid::where('auction_id', $auction->id)->join('users', 'users.id', '=', 'bids.user_id')->get(); $data = ['auction' => $auction]; foreach ($bids as $bid) { if ($bid->user_id != Auth::User()->id) { Mail::send('emails.sold', $data, function ($message) use($bid) { $message->from('*****@*****.**', 'Art sold'); $message->to($bid->email)->subject('The auction where you placed a bid on is sold.'); }); } } return view('art.sold', array('auction' => $auction, 'newest' => $newest)); } }
public function register() { $enabled_registrations = [2, 3]; $confirmation_code = str_random(30); $data = ['name' => Input::get('name'), 'email' => Input::get('email'), 'password' => Input::get('password'), 'role_id' => Input::get('role_id'), User::MOBILE_NUMBER => Input::get('mobile_number', NULL), User::DESCRIPTION => Input::get('description', NULL), User::IMAGE => Input::get('image', NULL), User::BIRTH_DATE => Input::get('birth_date', NULL), User::GENDER => Input::get('gender', NULL), 'confirmation_code' => $confirmation_code]; if (!in_array($data['role_id'], $enabled_registrations)) { return "Invalid role"; } if ($this->validator($data)) { $data = array_filter($data, 'strlen'); $user = User::create($data); $user->roles()->attach($data['role_id']); $role = Role::where('name', 'Expert')->select(['id'])->first(); if (!is_null($role)) { $role_id = $role->id; if ($role_id == $data['role_id']) { $user_extra = $this->insertExtra($user->id); //to be implemented // mail has to be sent to the admin all details of the newly signed up expert. $data = ["first_name" => isset($user_extra->first_name) && $user_extra->first_name != NULL ? $user_extra->first_name : "not available", "last_name" => isset($user_extra->last_name) && $user_extra->last_name != NULL ? $user_extra->last_name : "not available", "personal_email" => isset($user_extra->personal_email) && $user_extra->personal_email != NULL ? $user_extra->personal_email : "not available", "highest_degree" => isset($user_extra->highest_degree) && $user_extra->highest_degree != NULL ? $user_extra->highest_degree : "not available", "major_specialization" => isset($user_extra->major_specialization) && $user_extra->major_specialization != NULL ? $user_extra->major_specialization : "not available", "profession" => isset($user_extra->profession) && $user_extra->profession != NULL ? $user_extra->profession : "not available", "expert_area" => isset($user_extra->expert_area) && $user_extra->expert_area != NULL ? $user_extra->expert_area : "not available", "linkedin_url" => isset($user_extra->linkedin_url) && $user_extra->linkedin_url != NULL ? $user_extra->linkedin_url : "not available", "research_gate_id" => isset($user_extra->research_gate_id) && $user_extra->research_gate_id != NULL ? $user_extra->research_gate_id : "not available", "facebook_url" => isset($user_extra->facebook_url) && $user_extra->facebook_url != NULL ? $user_extra->facebook_url : "not available", "resume_url" => isset($user_extra->resume_url) && $user_extra->resume_url != NULL ? $user_extra->resume_url : "not available", "email" => isset($user->email) && $user->email != NULL ? $user->email : "not available", "mobile_number" => isset($user->mobile_number) && $user->mobile_number != NULL ? $user->mobile_number : "not available", "description" => isset($user->description) && $user->description != NULL ? $user->description : "not available", "gender" => isset($user->gender) && $user->gender != NULL ? $user->gender : "not available", "birth_date" => isset($user->birth_date) && $user->birth_date != NULL ? $user->birth_date : "not available", "image" => isset($user->image) && $user->image != NULL ? $user->image : "not available"]; Mail::send('email.email_to_admin', $data, function ($message) { $message->to("*****@*****.**", "Admin")->subject('New Expert Registration'); }); } else { $this->dispatch(new SendRegistrationEmail($user)); } } return "Registration Successfull"; } else { return "Validation Error"; } }
/** * Handle the event. * * @param UserHasRegistered $event */ public function handle(UserHasRegistered $event) { $user = $event->user; Mail::send('mail.template', ['user' => $event->user, 'isPartner' => $event->isPartner], function ($m) use($user) { $m->to($user->email)->subject('Activation du compte Both'); }); }
public function pdf(ReportingRepo $reporting) { $leads = $reporting->allClosedBySource(); Mail::send('emails.weekly_closed_leads', compact('leads'), function ($message) { $message->to('*****@*****.**', 'Joe Delise')->cc('*****@*****.**', 'Emily Crespo')->subject('Closed Leads Report'); }); }
/** Envia el correo * * @return boolean */ function send() { $data = $this->getData(); return Mail::send('emails.' . $this->getTemplate(), $data, function ($message) { $message->to($this->getEmail())->subject($this->getSubject()); }); }
protected function write(array $record) { $hasLevel = in_array($record['level_name'], config('dblogger.levels')); $hasChannel = in_array($record['message'], config('dblogger.channels')); $notifications = config('dblogger.notification'); $send_notification = 0; foreach ($notifications as $key => $value) { if ($key === $record['message']) { $send_notification = in_array($record['level_name'], $value); } } if ($send_notification) { $messages = config('dblogger.messages'); $data = ['record' => $record, 'action' => isset($messages[$record['message']]) ? $messages[$record['message']] : $record['message']]; Mail::send("dblogger::notification", $data, function ($message) { $message->to(config('dblogger.mail_to'))->subject(config('dblogger.mail_subject')); }); } if ($hasLevel && $hasChannel) { if (config('dblogger.service') === 'remote') { $this->post_remote($record); } else { Logger::create(['message' => $record['message'], 'context' => json_encode($record['context']), 'level' => $record['level'], 'level_name' => $record['level_name']]); } } }
public function index() { $data = array('email' => '*****@*****.**', 'name' => 'mohd aminuddin ali'); Mail::send('email.index', ['name' => $data['name'], 'email' => $data['email']], function ($message) use($data) { $message->to($data['email'], $data['name'])->subject('reset password'); }); }
public function getEmail() { Mail::send('teste.email', [], function ($m) { $m->from('*****@*****.**', 'CODE Commerce'); $m->to('*****@*****.**', 'teste name user - name')->subject('subject teste!'); }); }
public function sendEmail($view = null, $data = null) { $email_data = array('email' => $data['email'], 'role' => $data['role'], 'link' => $data['link']); Mail::send($view, $email_data, function ($message) use($data) { $message->to($data['to'])->subject($data['subject']); }); }
/** * Execute the job. * * @param Mailer $mailer * * @return void */ public function handle(Mailer $mailer) { $user = $this->user; Mail::send('email.confirmation', ['name' => $user->name], function ($message) use($user) { $message->to($user->email, $user->name)->subject('Confirmed'); }); }
public function deliver() { return Mail::send($this->view, $this->data, function ($message) { $message->from($this->from, $this->fromText); $message->to($this->email, $this->email)->subject($this->subject); }); }
public function send(BaseRequest $request) { Mail::send('emails.contact', ['data' => $request->all()], function ($m) { $m->from('*****@*****.**', 'Joel Podrebarac | Web Developer'); $m->to('*****@*****.**', 'Joel Podrebarac')->subject('A Message From Your Site'); }); }