add email signup flow
This commit is contained in:
parent
9945163a2f
commit
3dc9204979
27 changed files with 629 additions and 24 deletions
25
backend/app/Email/LaravelEmailFactory.php
Normal file
25
backend/app/Email/LaravelEmailFactory.php
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
<?php
|
||||
|
||||
namespace App\Email;
|
||||
|
||||
use RuntimeException;
|
||||
|
||||
class LaravelEmailFactory implements EmailFactory
|
||||
{
|
||||
public function makeConfirmationEmail(string $token): string
|
||||
{
|
||||
$configuredFrontendUrl = config('app.frontend_url');
|
||||
if (! is_string($configuredFrontendUrl)) {
|
||||
throw new RuntimeException('FRONTEND_URL must be configured');
|
||||
}
|
||||
|
||||
$frontendUrl = rtrim($configuredFrontendUrl, '/');
|
||||
$confirmationUrl = $frontendUrl
|
||||
.'/confirm-email?token='.urlencode($token);
|
||||
|
||||
return "Welcome to Attainly.\n\n"
|
||||
."Confirm your email and choose a password:\n"
|
||||
."{$confirmationUrl}\n\n"
|
||||
.'This link expires in 10 minutes.';
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue