updated tokens and emails

This commit is contained in:
2024-05-06 20:13:31 +10:00
parent 39ea570f3a
commit 742da4bf17
35 changed files with 627 additions and 340 deletions

View File

@@ -25,7 +25,7 @@ $billing_same_home = $user->home_address === $user->billing_address
</div>
<div class="flex gap-8">
<div class="flex-1">
<x-ui.input type="email" label="Email" name="email" value="{{ $user->email }}" label-notice="{{ $user->email_update_pending ? 'There is a pending request to change the email address of this account' : '' }}"/>
<x-ui.input type="email" label="Email" name="email" value="{{ $user->email }}" info="{{ $user->email_update_pending ? 'Pending request to change to ' . $user->email_update_pending : '' }}"/>
</div>
<div class="flex-1">
<x-ui.input label="Phone" name="phone" value="{{ $user->phone }}" />

View File

@@ -0,0 +1,7 @@
<x-layout :bodyClass="'image-background'">
<x-dialog>
<x-slot:title>Check your inbox</x-slot:title>
<x-slot:header><p class="text-center">Check your email for the registration link we just sent. Click the link to finish setting up your account.</p></x-slot:header>
<x-slot:footer class="mt-8"><x-ui.button href="{{ route('index') }}">Home</x-ui.button></x-slot:footer>
</x-dialog>
</x-layout>

View File

@@ -1,14 +0,0 @@
@component('mail::message', ['username' => $username, 'email' => $email])
<h2 class="center narrow">Confirm your new email address</h2>
<p class="center narrow">A request was made to change your email address at STEMMechanics to {{ $newEmail }}.</p>
<p class="center narrow">For your security, this link <strong>can only be used once</strong> and <strong>expires after 10 minutes.</strong></p>
<p class="center narrow">
@component('mail::button', ['url' => route('update.email', ['token' => $token])])
Update Email
@endcomponent
</p>
<hr />
<h3>Why did I get this link?</h3>
<p class="sub">Someone asked to change the email address associated with an account at STEMMechanics with this email.</p>
<p class="sub">If this wasn't you, you can ignore this email.</p>
@endcomponent

View File

@@ -0,0 +1,6 @@
@component('mail::message', ['email' => $email])
<p>Hey there!</p>
<p>Just a quick line to confirm that your email address has now been updated at STEMMechanics!</p>
<p>Warm regards,</p>
<p>—James 😁</p>
@endcomponent

View File

@@ -0,0 +1,16 @@
@component('mail::message', ['email' => $email])
<p>Hey there!</p>
<p>You requested to update your email address at STEMMechanics to {{ $newEmail }}. Click the link below to confirm this change:</p>
<p class="tall center">
@component('mail::button', ['url' => $update_url])
Update Email
@endcomponent
</p>
<p>Remember, the link expires in 30 minutes.</p>
<p>Warm regards,</p>
<p>—James 😁</p>
@slot('subcopy')
<h4>Why did I get this email?</h4>
<p class="sub">Someone asked to change the email address associated with an account at STEMMechanics with this email. If this wasn't you, you can ignore this email.</p>
@endslot
@endcomponent

View File

@@ -1,13 +0,0 @@
@component('mail::message', ['username' => $username, 'email' => $email])
<h2 class="center narrow">Follow this link to log in to your account.</h2>
<p class="center narrow">For your security, this link <strong>can only be used once</strong> and <strong>expires after 10 minutes.</strong></p>
<p class="center narrow">
@component('mail::button', ['url' => route('login', ['token' => $token])])
Log in
@endcomponent
</p>
<hr />
<h3>Why did I get this link?</h3>
<p class="sub">Someone asked for a login link to log in to STEMMechanics with this email.</p>
<p class="sub">If this wasn't you, you can ignore this email.</p>
@endcomponent

View File

@@ -0,0 +1,16 @@
@component('mail::message', ['email' => $email])
<p>Hey there!</p>
<p>You requested a link to log in to STEMMechanics, and here it is!</p>
<p class="tall center">
@component('mail::button', ['url' => $login_url])
Log in
@endcomponent
</p>
<p>Remember, the link expires in 10 minutes and can only be used once.</p>
<p>Warm regards,</p>
<p>—James 😁</p>
@slot('subcopy')
<h4>Why did I get this email?</h4>
<p class="sub">Someone asked for a link to log in to STEMMechanics with this email address. If this wasn't you, you can ignore this email.</p>
@endslot
@endcomponent

View File

@@ -1,13 +0,0 @@
@component('mail::message', ['username' => $username, 'email' => $email])
<h2 class="center narrow">Follow this link to register your account.</h2>
<p class="center narrow">For your security, this link <strong>can only be used once</strong> and <strong>expires after 10 minutes.</strong></p>
<p class="center narrow">
@component('mail::button', ['url' => route('login', ['token' => $token])])
Register
@endcomponent
</p>
<hr />
<h3>Why did I get this link?</h3>
<p class="sub">Someone asked to register an account at STEMMechanics with this email.</p>
<p class="sub">If this wasn't you, you can ignore this email.</p>
@endcomponent

View File

@@ -0,0 +1,17 @@
@component('mail::message', ['email' => $email])
<p>Hey there!</p>
<p>We're thrilled to have you join us. To complete your registration and officially become part of the community, just click link below:</p>
<p class="tall center">
@component('mail::button', ['url' => $register_url])
Register
@endcomponent
</p>
<p>Remember, the link expires in 10 minutes and can only be used once, so act fast!</p>
<p>Warm regards,</p>
<p>—James 😁</p>
@slot('subcopy')
<h4>Why did I get this email?</h4>
<p class="sub">Someone asked to register at STEMMechanics with this email address. If this wasn't you, you can ignore this email.</p>
@endslot
@endcomponent

View File

@@ -0,0 +1,7 @@
@component('mail::message', ['email' => $email, 'unsubscribe' => $unsubscribe])
@include('emails.welcome')
<hr />
<h3>Why did I get this email?</h3>
<p>Someone asked to subscribe to our mailing list at STEMMechanics with this email address.</p>
<p>If this wasn't you, you can <a href="{{$unsubscribe}}">unsubscribe</a>.</p>
@endcomponent

View File

@@ -0,0 +1,12 @@
@component('mail::message', ['email' => $email])
<p>Welcome to the community!</p>
<p>Really glad to have you here and can't wait to see you at one of our workshops.</p>
<p>You'll get information about upcoming workshops as it comes out.</p>
<p>Even though this is (of course) an automated email, just wanted to say thanks for registering and intro myself.</p>
<p>If you didn't know, I'm James and I'm the founder of STEMMechanics. I promise not to spam you, sell your data, or send you anything I don't think is absolutely necessary.</p>
<p>You know a bit about me but I don't know really anything about you...</p>
<p><strong>If you're up for it</strong>, reply to this email and tell me a bit about yourself and also let me know what workshops you are interested in?</p>
<p>I read and reply to every one 😁</p>
<p>Talk soon</p>
<p>—James</p>
@endcomponent

View File

@@ -1,11 +1 @@
<tr>
<td>
<table class="footer" align="center" width="570" cellpadding="0" cellspacing="0" role="presentation">
<tr>
<td class="content-cell" align="center">
{{ Illuminate\Mail\Markdown::parse($slot) }}
</td>
</tr>
</table>
</td>
</tr>

View File

@@ -1,7 +1,5 @@
@props(['url', 'username'])
<tr>
<td class="header">
<a href="{{ $url }}" style="display: inline-block;">
@props(['url'])
<a href="{{ $url }}">
<img
alt="STEMMechanics Logo"
src="https://www.stemmechanics.com.au/logo.svg"
@@ -9,6 +7,3 @@
height="31"
/>
</a>
<h1>Hello, {{ $username }}</h1>
</td>
</tr>

View File

@@ -25,33 +25,46 @@ width: 100% !important;
</style>
</head>
<body>
<table class="wrapper" align="center" width="100%" cellpadding="0" cellspacing="0" role="presentation">
<tr>
<td align="center">
<!-- Email Body -->
<table class="inner-body" align="center" width="570" cellpadding="0" cellspacing="0" role="presentation">
<!-- Body header -->
<tr>
<td class="header" align="center">
{{ $header ?? '' }}
</td>
</tr>
<table class="wrapper" width="100%" cellpadding="0" cellspacing="0" role="presentation">
<tr>
<td align="center">
<table class="content" width="100%" cellpadding="0" cellspacing="0" role="presentation">
{{ $header ?? '' }}
<!-- Email Body -->
<tr>
<td class="body" width="100%" cellpadding="0" cellspacing="0" style="border: hidden !important;">
<table class="inner-body" align="center" width="570" cellpadding="0" cellspacing="0" role="presentation">
<!-- Body content -->
<tr>
<td class="content-cell">
{{ Illuminate\Mail\Markdown::parse($slot) }}
{{ $subcopy ?? '' }}
</td>
</tr>
</table>
</td>
</tr>
{{ $footer ?? '' }}
</table>
</td>
</tr>
</table>
<!-- Body content -->
<tr>
<td class="content-cell">
{{ Illuminate\Mail\Markdown::parse($slot) }}
</td>
</tr>
@isset($subcopy)
<tr>
<td class="content-cell">
<hr />
{{ $subcopy ?? '' }}
</td>
</tr>
@endisset
</table>
</td>
</tr>
<tr>
<td>
<table class="footer" align="center" width="570" cellpadding="0" cellspacing="0" role="presentation">
<tr>
<td class="content-cell" align="center">
{{ $footer ?? '' }}
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>

View File

@@ -1,7 +1,7 @@
<x-mail::layout>
{{-- Header --}}
<x-slot:header>
<x-mail::header :url="config('app.url')" username="{{ $username }}" />
<x-mail::header :url="config('app.url')"/>
</x-slot:header>
{{-- Body --}}
@@ -10,9 +10,7 @@
{{-- Subcopy --}}
@isset($subcopy)
<x-slot:subcopy>
<x-mail::subcopy>
{{ $subcopy }}
</x-mail::subcopy>
{{ Illuminate\Mail\Markdown::parse($subcopy) }}
</x-slot:subcopy>
@endisset
@@ -20,9 +18,9 @@
<x-slot:footer>
<x-mail::footer>
<p>This email was sent to <a href="mailto:{{ $email }}">{{ $email }}</a><br />
<a href="{{ config('app.url') }}">{{ config('app.name') }}</a> | 1/4 Jordan Street | Edmonton, QLD 4869 Australia<br />
<a href="{{ route('index') }}">{{ config('app.name') }}</a> | 1/4 Jordan Street | Edmonton, QLD 4869 Australia<br />
© {{ date('Y') }} {{ config('app.name') }}. {{ __('All rights reserved.') }}<br />
<a href="{{ config('app.url') }}/privacy">Privacy Policy</a>
<a href="{{ route('privacy') }}">Privacy Policy</a> | <a href="{{ route('terms-conditions') }}">Terms & Conditions</a> @isset($unsubscribe) | <a href="{{ $unsubscribe }}">Unsubscribe</a>@endisset
</p>
</x-mail::footer>
</x-slot:footer>

View File

@@ -1,7 +1 @@
<table class="subcopy" width="100%" cellpadding="0" cellspacing="0" role="presentation">
<tr>
<td>
{{ Illuminate\Mail\Markdown::parse($slot) }}
</td>
</tr>
</table>

View File

@@ -10,8 +10,8 @@ body *:not(html):not(style):not(br):not(tr):not(code) {
body {
-webkit-text-size-adjust: none;
background-color: #ffffff;
color: #718096;
background-color: #eee;
color: #444;
height: 100%;
line-height: 1.4;
margin: 0;
@@ -31,7 +31,7 @@ a {
color: #3869d4;
}
a img {
img {
border: none;
}
@@ -39,10 +39,11 @@ a img {
h1 {
color: #3d4852;
font-size: 24px;
font-weight: bold;
margin-top: 14px;
text-align: center;
font-size: 12px;
margin: 0;
padding: 0;
display: inline-block;
border: 1px solid red;
}
h2 {
@@ -59,9 +60,17 @@ h3 {
text-align: left;
}
h4 {
font-size: 12px;
font-weight: bold;
margin-top: 0;
margin-bottom: 0;
text-align: left;
}
p {
font-size: 16px;
line-height: 1.5em;
font-size: 14px;
line-height: 1.2em;
margin-top: 0;
text-align: left;
}
@@ -88,9 +97,9 @@ hr {
-premailer-cellpadding: 0;
-premailer-cellspacing: 0;
-premailer-width: 100%;
background-color: #edf2f7;
margin: 0;
padding: 0;
background-color: #eee;
margin: 30px auto;
padding: 12px;
width: 100%;
}
@@ -107,23 +116,21 @@ hr {
text-align: center;
}
.narrow {
padding-left: 32px;
padding-right: 32px;
.tall {
padding-top: 16px;
padding-bottom: 16px;
}
/* Header */
.header {
padding: 25px 0;
text-align: center;
padding-top: 28px;
padding-bottom: 32px;
}
.header a {
color: #3d4852;
font-size: 19px;
font-weight: bold;
text-decoration: none;
display: inline-block;
}
/* Logo */
@@ -154,24 +161,13 @@ hr {
-premailer-width: 570px;
background-color: #ffffff;
border-color: #e8e5ef;
border-radius: 2px;
border-radius: 8px;
border-width: 1px;
box-shadow: 0 2px 0 rgba(0, 0, 150, 0.025), 2px 4px 0 rgba(0, 0, 150, 0.015);
box-shadow: 4px 4px 12px rgba(0, 0, 0, 0.05);
margin: 0 auto;
padding: 0;
padding: 0 0 32px;
width: 570px;
}
/* Subcopy */
.subcopy {
border-top: 1px solid #e8e5ef;
margin-top: 25px;
padding-top: 25px;
}
.subcopy p {
font-size: 14px;
max-width: 570px;
}
/* Footer */
@@ -181,7 +177,7 @@ hr {
-premailer-cellspacing: 0;
-premailer-width: 570px;
margin: 0 auto;
padding: 0;
padding: 32px 0 0;
text-align: center;
width: 570px;
}
@@ -204,7 +200,7 @@ hr {
-premailer-cellpadding: 0;
-premailer-cellspacing: 0;
-premailer-width: 100%;
margin: 30px auto;
margin: 0;
width: 100%;
}
@@ -223,8 +219,9 @@ hr {
}
.content-cell {
max-width: 100vw;
padding: 32px;
max-width: 570px;
padding-left: 32px;
padding-right: 32px;
}
/* Buttons */
@@ -246,10 +243,6 @@ hr {
display: inline-block;
overflow: hidden;
text-decoration: none;
}
.button-blue,
.button-primary {
background-color: #2d3748;
border-bottom: 8px solid #2d3748;
border-left: 18px solid #2d3748;
@@ -257,6 +250,15 @@ hr {
border-top: 8px solid #2d3748;
}
.button-blue,
.button-primary {
background-color: #0284C7;
border-bottom: 8px solid #0284C7;
border-left: 18px solid #0284C7;
border-right: 18px solid #0284C7;
border-top: 8px solid #0284C7;
}
.button-green,
.button-success {
background-color: #48bb78;

View File

@@ -1 +1 @@
{{ $slot }}: {{ $url }}
{{ $url }}

View File

@@ -1 +1 @@
{{ $slot }}: {{ $url }}
{{ $slot }}

View File

@@ -1,9 +1,21 @@
{!! strip_tags($header ?? '') !!}
{!! strip_tags($slot) !!}
@isset($subcopy)
@php
$slot = str_replace([' ', "\t"], '', $slot);
$slot = str_replace('</p>', "\r\n", $slot);
$slot = strip_tags($slot);
@endphp
{!! $slot !!}
{!! strip_tags($subcopy) !!}
@isset($subcopy)
@php
$subcopy = str_replace([' ', "\t"], '', $subcopy);
$subcopy = str_replace("</h4>\n", " - ", $subcopy);
$subcopy = str_replace(['<br>', '<br />', '</p>'], "\r\n", $subcopy);
$subcopy = strip_tags($subcopy);
@endphp
{!! $subcopy !!}
@endisset
------
{!! strip_tags($footer ?? '') !!}

View File

@@ -1,27 +1,24 @@
<x-mail::layout>
{{-- Header --}}
<x-slot:header>
<x-mail::header :url="config('app.url')">
{{ config('app.name') }}
</x-mail::header>
</x-slot:header>
{{-- Body --}}
{{ $slot }}
{{-- Body --}}
{{ $slot }}
@isset($subcopy)
<x-slot:subcopy>
{{ $subcopy }}
</x-slot:subcopy>
@endisset
{{-- Subcopy --}}
@isset($subcopy)
<x-slot:subcopy>
<x-mail::subcopy>
{{ $subcopy }}
</x-mail::subcopy>
</x-slot:subcopy>
@endisset
{{-- Footer --}}
<x-slot:footer>
<x-mail::footer>
© {{ date('Y') }} {{ config('app.name') }}. @lang('All rights reserved.')
</x-mail::footer>
</x-slot:footer>
{{-- Footer --}}
<x-slot:footer>
<x-mail::footer>
This email was sent to {{ $email }}
STEMMechanics | 1/4 Jordan Street | Edmonton, QLD 4869 Australia
© {{ date('Y') }} {{ config('app.name') }}. {{ __('All rights reserved.') }}
@isset($unsubscribe) Unsubscribe: {{ $unsubscribe }}@endisset
</x-mail::footer>
</x-slot:footer>
</x-mail::layout>

View File

@@ -1 +1,2 @@
{{ $slot }}