PageRenderTime 22ms CodeModel.GetById 18ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/app/Laravel/Events/SendEmail.php

https://bitbucket.org/cityserv/techreportph
PHP | 32 lines | 19 code | 7 blank | 6 comment | 0 complexity | 2f8b60e4956891b4bd63ed002073b3d4 MD5 | raw file
 1<?php namespace App\Laravel\Events;
 2
 3
 4use App\Laravel\Models\ContactInfo;
 5use Illuminate\Queue\SerializesModels;
 6use Mail,Str;
 7// use App\Constech\Models\GeneralSetting;
 8
 9class SendEmail extends Event {
10
11	use SerializesModels;
12
13	/**
14	 * Create a new event instance.
15	 *
16	 * @return void
17	 */
18	public function __construct(array $form_data)
19	{
20		$this->data['input'] = $form_data['input'];
21	}
22
23	public function job(){	
24		$data = ['name' => $this->data['input']['name'],'email' => $this->data['input']['email'],];
25
26		Mail::send('emails.subscribe', $data, function($message){
27			$message->from('no_reply@asean-bac.org',"ASEAN BAC");
28			$message->to($this->data['input']['email']);
29			$message->subject("ABAC Subscription.");
30		});
31	}
32}