This repository was archived by the owner on Jul 26, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
348 additions
and
176 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<?php | ||
|
||
namespace App\Http\Controllers; | ||
use Illuminate\Http\Request; | ||
use Mail; | ||
|
||
use App\Http\Requests; | ||
use App\Http\Controllers\Controller; | ||
|
||
class MailController extends Controller { | ||
|
||
public function basic_email($request) { | ||
$id = $request->id; | ||
$email = $request->email; | ||
$subject = 'Active Your Account In Yes Soft'; | ||
$first_name = $request->first_name; | ||
|
||
$data = array('name'=>$first_name,'id'=>$id); | ||
|
||
Mail::send('mail', $data, function($message) use($email , $subject, $first_name) { | ||
$message | ||
->subject($subject) | ||
->from('[email protected]','Yes Soft') | ||
->to($email, $first_name); | ||
}); | ||
echo "Activate Email Sent. Check your inbox."; | ||
} | ||
} | ||
/*class MailController extends Controller { | ||
public function send_active_email() { | ||
// $id = $user->id; | ||
// $first_name = $user->first_name; | ||
$data = array('name'=>'$first_name','id'=> 4); | ||
Mail::send(['text'=>'mail'], $data, function($message) { | ||
// $first_name = $user->first_name; | ||
// $email = $user->email; | ||
$subject = 'Active Your Account'; | ||
$message->from(env('MAIL_USERNAME') , 'Yes Soft'); | ||
$message->to('$email', '$first_name')->subject($subject); | ||
}); | ||
echo "Activate Email Sent. Check your inbox."; | ||
} | ||
}*/ |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
namespace App\Jobs; | ||
|
||
use App\Mail\sendEmail; | ||
use Illuminate\Bus\Queueable; | ||
use Illuminate\Queue\SerializesModels; | ||
use Illuminate\Queue\InteractsWithQueue; | ||
use Illuminate\Contracts\Queue\ShouldQueue; | ||
use Illuminate\Foundation\Bus\Dispatchable; | ||
use Illuminate\Support\Facades\Mail; | ||
|
||
class sendEmailJob implements ShouldQueue | ||
{ | ||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels; | ||
|
||
/** | ||
* Create a new job instance. | ||
* | ||
* @return void | ||
*/ | ||
public function __construct() | ||
{ | ||
// | ||
} | ||
|
||
/** | ||
* Execute the job. | ||
* | ||
* @return void | ||
*/ | ||
public function handle() | ||
{ | ||
Mail::to('[email protected]')->send(new sendEmail()); | ||
} | ||
} |
This file contains 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
36 changes: 36 additions & 0 deletions
36
database/migrations/2019_04_27_020124_create_jobs_table.php
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
use Illuminate\Support\Facades\Schema; | ||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Database\Migrations\Migration; | ||
|
||
class CreateJobsTable extends Migration | ||
{ | ||
/** | ||
* Run the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function up() | ||
{ | ||
Schema::create('jobs', function (Blueprint $table) { | ||
$table->bigIncrements('id'); | ||
$table->string('queue')->index(); | ||
$table->longText('payload'); | ||
$table->unsignedTinyInteger('attempts'); | ||
$table->unsignedInteger('reserved_at')->nullable(); | ||
$table->unsignedInteger('available_at'); | ||
$table->unsignedInteger('created_at'); | ||
}); | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function down() | ||
{ | ||
Schema::dropIfExists('jobs'); | ||
} | ||
} |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<h1>Hi {{ $name }}</h1> | ||
<p>Open link below to active your account.</p> | ||
<a href="http://localhost:8000/admin/user/{{$id}}/activate">Click to Active Email</a> | ||
|
||
|
This file contains 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