-
Notifications
You must be signed in to change notification settings - Fork 57
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
6 changed files
with
201 additions
and
157 deletions.
There are no files selected for viewing
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
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 |
---|---|---|
|
@@ -11,33 +11,41 @@ | |
|
||
class ResourceDigestEmail extends Mailable implements ShouldQueue | ||
{ | ||
use Queueable, SerializesModels; | ||
|
||
public $resources; | ||
|
||
public function __construct($resources) | ||
{ | ||
$this->resources = $resources; | ||
} | ||
|
||
public function envelope() | ||
{ | ||
return new Envelope( | ||
subject: 'New Onramp Resources!', | ||
from: '[email protected]', | ||
); | ||
} | ||
|
||
public function content() | ||
{ | ||
return new Content( | ||
markdown: 'emails.resource-digest', | ||
with: ['resources' => $this->resources], | ||
); | ||
} | ||
|
||
public function attachments(): array | ||
{ | ||
return []; | ||
} | ||
use Queueable, SerializesModels; | ||
|
||
public $resources; | ||
public $user; | ||
public $unsubscribeUrl; | ||
|
||
public function __construct($resources, $user, $unsubscribeUrl) | ||
{ | ||
$this->resources = $resources; | ||
$this->user = $user; | ||
$this->unsubscribeUrl = $unsubscribeUrl; | ||
} | ||
|
||
public function envelope() | ||
{ | ||
return new Envelope( | ||
subject: 'New Onramp Resources!', | ||
from: '[email protected]', | ||
); | ||
} | ||
|
||
public function content() | ||
{ | ||
return new Content( | ||
markdown: 'emails.resource-digest', | ||
with: [ | ||
'resources' => $this->resources, | ||
'user' => $this->user, | ||
'unsubscribeUrl' => $this->unsubscribeUrl, | ||
], | ||
); | ||
} | ||
|
||
public function attachments(): array | ||
{ | ||
return []; | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
database/migrations/2024_08_09_215321_add_unsubscribe_token_to_users_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,22 @@ | ||
<?php | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Support\Facades\Schema; | ||
|
||
return new class extends Migration | ||
{ | ||
public function up() | ||
{ | ||
Schema::table('users', function (Blueprint $table) { | ||
$table->string('unsubscribe_token', 60)->unique()->nullable(); | ||
}); | ||
} | ||
|
||
public function down() | ||
{ | ||
Schema::table('users', function (Blueprint $table) { | ||
$table->dropColumn('unsubscribe_token'); | ||
}); | ||
} | ||
}; |
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