Skip to content

Commit

Permalink
Added email uuid column, which should solve #24
Browse files Browse the repository at this point in the history
  • Loading branch information
Raikia authored and Raikia committed Jan 10, 2017
1 parent 950fd23 commit e34693b
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/Email.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class Email extends Model
const CANCELLED = 8;
const FAILED = 9;

protected $fillable = ['sender_name', 'sender_email', 'receiver_name', 'receiver_email', 'subject', 'message', 'tls', 'has_attachment', 'attachment', 'status'];
protected $fillable = ['sender_name', 'sender_email', 'receiver_name', 'receiver_email', 'subject', 'message', 'tls', 'has_attachment', 'attachment', 'status', 'uuid'];

protected $touches = ['campaign'];

Expand Down
1 change: 1 addition & 0 deletions app/EmailTemplate.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ public function craft_email($campaign, $targetUser)
$email->tls = true; // Maybe change this to be editable in the campaign
$email->has_attachment = false; // Maybe change this to be editable in the campaign
$email->status = Email::NOT_SENT;
$email->uuid = $targetUser->uuid($campaign);
$email->save();
return $email;
}
Expand Down
31 changes: 31 additions & 0 deletions database/migrations/2017_01_10_034451_add_uuid_to_email.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class AddUuidToEmail extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('emails', function (Blueprint $table) {
$table->string('uuid')->nullable();
});
}

/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('emails', function (Blueprint $table) {
$table->dropColumn('uuid');
});
}
}

0 comments on commit e34693b

Please sign in to comment.