#25: Improved email branding and CASL compliance.

This commit is contained in:
Peter Deltchev 2016-12-30 10:27:49 -08:00
parent 1e670b673f
commit f85e8fc43a
4 changed files with 29 additions and 21 deletions

View file

@ -20,6 +20,7 @@
namespace Poniverse\Ponyfm\Mail; namespace Poniverse\Ponyfm\Mail;
use Carbon\Carbon;
use Illuminate\Bus\Queueable; use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable; use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels; use Illuminate\Queue\SerializesModels;
@ -126,11 +127,13 @@ abstract class BaseNotification extends Mailable {
->view("emails.html.notifications.{$templateName}") ->view("emails.html.notifications.{$templateName}")
->text("emails.plaintext.notifications.{$templateName}") ->text("emails.plaintext.notifications.{$templateName}")
->with(array_merge($extraVariables, [ ->with(array_merge($extraVariables, [
'notificationUrl' => $this->generateNotificationUrl(), 'notificationUrl' => $this->generateNotificationUrl(),
'unsubscribeUrl' => $this->generateUnsubscribeUrl(), 'unsubscribeUrl' => $this->generateUnsubscribeUrl(),
'thumbnailUrl' => $this->activityRecord->thumbnail_url, 'thumbnailUrl' => $this->activityRecord->thumbnail_url,
'recipientName' => $this->emailRecord->getUser()->display_name, 'recipientName' => $this->emailRecord->getUser()->display_name,
'accountSettingsUrl' => $this->emailRecord->getUser()->getSettingsUrl(), 'accountSettingsUrl' => $this->emailRecord->getUser()->getSettingsUrl(),
'replyEmailAddress' => config('mail.from.address'),
'currentYear' => Carbon::now()->year,
])); ]));
} }
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

View file

@ -16,28 +16,33 @@
<container> <container>
<row> <row>
<columns> <columns>
<h1>Pony.fm</h1> <center><h1><img src="\{{ $message->embed(resource_path('emails/src/assets/img/email-header.jpg')) }}" alt="Pony.fm - Unlimited Pony Music"/></h1></center>
</columns> </columns>
</row> </row>
{{!-- Pages you create in the src/pages/ folder are inserted here when the flattened emails are created. --}} {{!-- Pages you create in the src/pages/ folder are inserted here when the flattened emails are created. --}}
{{> body}} {{> body}}
<row><columns></columns></row>
<row> <row>
<columns large="6"> <columns large="7">
<h6>What&#39;s this?</h6> <h4><small>Why did I get this email?</small></h4>
<p><small>Pony.fm can now send you notifications via email! You can control what you get email notifications for in your <a href="\{{ $accountSettingsUrl }}">account settings</a>.</small></p> <p><small>Pony.fm can now email your notifications to you! Change what
<p><small><a href="\{{ $unsubscribeUrl }}" target="_blank">Unsubscribe from this kind of email</a></small></p> you get email notifications for in your <a href="\{{ $accountSettingsUrl }}">account settings</a>.
You can also <a href="\{{ $unsubscribeUrl }}" target="_blank">unsubscribe</a> from this kind of email.</small></p>
</columns> </columns>
<columns large="6"> <columns large="5">
<br> <br>
<p><small> <p>
Sent with &#9829; to \{{ $recipientName }}<br> <small><strong>Any questions?</strong> Reply to this email
<br> or hit us up at <a href="\{{ $replyEmailAddress }}">\{{ $replyEmailAddress }}</a>!
Poniverse<br> </small>
248-1641 Lonsdale Avenue<br> </p>
North Vancouver<br> <p><small>Sent with &#9829; to \{{ $recipientName }}</small></p>
BC V7M 2J5<br> </columns>
Canada </row>
</small></p> <row>
<columns>
<p class="text-center"><small>Pony.fm, a Poniverse project<br>
248-1641 Lonsdale Avenue, North Vancouver, BC V7M 2J5, Canada</small></p>
</columns> </columns>
</row> </row>
</container> </container>

View file

@ -11,7 +11,7 @@ layout: notification
<a href="\{{ $notificationUrl }}" target="_blank"> <a href="\{{ $notificationUrl }}" target="_blank">
<row> <row>
<columns small="4" large="2" class="large-offset-2"> <columns small="4" large="2" class="large-offset-1">
<img src="\{{ $message->embed($thumbnailUrl) }}" /> <img src="\{{ $message->embed($thumbnailUrl) }}" />
</columns> </columns>
<columns small="8"> <columns small="8">