Integrate Mail, Nexmo and Slack notifications into Cachet

This commit is contained in:
James Brooks
2016-12-30 16:22:05 +00:00
parent 056b80a2bc
commit b8a9f41ae4
43 changed files with 1104 additions and 682 deletions
-26
View File
@@ -91,32 +91,6 @@ return [
'unsubscribed' => 'Your email subscription has been cancelled.',
'failure' => 'Something went wrong with the subscription.',
'already-subscribed' => 'Cannot subscribe :email because they\'re already subscribed.',
'verify' => [
'text' => "Please confirm your email subscription to :app_name status updates.\n:link",
'html' => '<p>Please confirm your email subscription to :app_name status updates.</p>',
'button' => 'Confirm Subscription',
],
'maintenance' => [
'subject' => '[Maintenance Scheduled] :name',
],
'incident' => [
'subject' => '[New Incident] :status: :name',
],
'component' => [
'subject' => 'Component Status Update',
'text' => 'The component :component_name has seen a status change. The component is now at :component_human_status.\nThank you, :app_name',
'html' => '<p>The component :component_name has seen a status change. The component is now at :component_human_status.</p><p>Thank you, :app_name</p>',
'tooltip-title' => 'Subscribe to notifications for :component_name.',
],
],
],
'users' => [
'email' => [
'invite' => [
'text' => "You have been invited to the team :app_name status page, to sign up follow the next link.\n:link\nThank you, :app_name",
'html' => '<p>You have been invited to the team :app_name status page, to sign up follow the next link.</p><p><a href=":link">:link</a></p><p>Thank you, :app_name</p>',
],
],
],
+65
View File
@@ -0,0 +1,65 @@
<?php
/*
* This file is part of Cachet.
*
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
'component' => [
'status_update' => [
'subject' => 'Component Status Updated',
'title' => 'A component\'s status was updated!',
'content' => ':name status changed from :old_status to :new_status.',
],
],
'incident' => [
'new' => [
'subject' => 'New Incident Reported',
'content' => ':name was reported',
'title' => 'A new incident was reported at :app_name status page.',
'action' => 'View',
],
'update' => [
'subject' => 'Incident Updated',
'content' => ':name was updated',
'title' => ':name was updated to :new_status',
'action' => 'View',
],
],
'schedule' => [
'new' => [
'subject' => 'New Schedule Created',
'content' => ':name was scheduled for :date',
'title' => 'A new scheduled maintenance was created.',
'action' => 'View',
],
],
'subscriber' => [
'verify' => [
'subject' => 'Verify Your Subscription',
'content' => 'Click to verify your subscription to :app_name status page.',
'title' => 'Verify your subscription to :app_name status page.',
'action' => 'Verify',
],
],
'system' => [
'test' => [
'subject' => 'Ping from Cachet!',
'content' => 'This is a test notification from Cachet!',
'title' => '🔔',
],
],
'user' => [
'invite' => [
'subject' => 'Your invitation is inside...',
'content' => 'You have been invited to join :app_name status page.',
'title' => 'You\'re invited to join :app_name status page.',
'action' => 'Accept',
],
],
];
@@ -1,20 +0,0 @@
@extends('layout.emails')
@section('content')
{!! trans('cachet.subscriber.email.component.html', ['component_name' => $component_name, 'component_human_status' => $component_human_status, 'app_name' => $app_name]) !!}
<table class="body-action" align="center" width="100%" cellpadding="0" cellspacing="0">
<tr>
<td align="center">
<div>
<!--[if mso]><v:roundrect xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w="urn:schemas-microsoft-com:office:word" href="{{ $manage_link }}" style="height:45px;v-text-anchor:middle;width:200px;" arcsize="7%" stroke="f" fill="t">
<v:fill type="tile" color="#22BC66" />
<w:anchorlock/>
<center style="color:#ffffff;font-family:sans-serif;font-size:15px;">{!! trans('cachet.subscriber.email.manage') !!}</center>
</v:roundrect><![endif]-->
<a href="{{ $manage_link }}" class="button button--green">{!! trans('cachet.subscriber.email.manage') !!}</a>
</div>
</td>
</tr>
</table>
@stop
@@ -1,7 +0,0 @@
{!! trans('cachet.subscriber.email.component.text', ['component_name' => $component_name, 'component_human_status' => $component_human_status, 'app_name' => $app_name]) !!}
{!! trans('cachet.subscriber.email.manage') !!} {{ $manage_link }}
@if($show_support)
{!! trans('cachet.powered_by', ['app' => $app_name]) !!}
@endif
@@ -1,40 +0,0 @@
@extends('layout.emails')
@section('content')
<h1 class="align-center">{!! $name !!}</h1>
<table class="border-rounded" width="100%" cellpadding="0" cellspacing="0">
<tr>
<td>
<p class="compressed">
<strong>{!! $status !!}</strong>
{!! $html_content !!}
{!! $timestamp !!}
</p>
</td>
<tr>
</table>
<table class="body-action" align="center" width="100%" cellpadding="0" cellspacing="0">
<tr>
<td align="center">
<div>
<!--[if mso]><v:roundrect xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w="urn:schemas-microsoft-com:office:word" href="{{ $manage_link }}" style="height:45px;v-text-anchor:middle;width:200px;" arcsize="7%" stroke="f" fill="t">
<v:fill type="tile" color="#22BC66" />
<w:anchorlock/>
<center style="color:#ffffff;font-family:sans-serif;font-size:15px;">{!! trans('cachet.subscriber.email.manage') !!}</center>
</v:roundrect><![endif]-->
<a href="{{ $manage_link }}" class="button button--green">{!! trans('cachet.subscriber.email.manage') !!}</a>
</div>
</td>
</tr>
</table>
<table class="body-sub" align="center">
<tr>
<td align="center">
<p class="sub"><a href="{{ $unsubscribe_link }}">{!! trans('cachet.subscriber.email.unsubscribe') !!}</a></p>
</td>
</tr>
</table>
@stop
@@ -1,13 +0,0 @@
{!! $name !!}
{!! $status !!}
{!! $text_content !!}
{!! $timestamp !!}
{!! trans('cachet.subscriber.email.manage') !!} {{ $manage_link }}
{!! trans('cachet.subscriber.email.unsubscribe') !!} {{ $unsubscribe_link }}
@if($show_support)
{!! trans('cachet.powered_by', ['app' => $app_name]) !!}
@endif
@@ -1,40 +0,0 @@
@extends('layout.emails')
@section('content')
<h1 class="align-center">{!! $name !!}</h1>
<table class="border-rounded" width="100%" cellpadding="0" cellspacing="0">
<tr>
<td>
<p class="compressed">
<strong>{!! $status !!} @if($has_component) ({{ $component_name }}) @endif</strong>
{!! $html_content !!}
{!! $timestamp !!}
</p>
</td>
<tr>
</table>
<table class="body-action" align="center" width="100%" cellpadding="0" cellspacing="0">
<tr>
<td align="center">
<div>
<!--[if mso]><v:roundrect xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w="urn:schemas-microsoft-com:office:word" href="{{ $manage_link }}" style="height:45px;v-text-anchor:middle;width:200px;" arcsize="7%" stroke="f" fill="t">
<v:fill type="tile" color="#22BC66" />
<w:anchorlock/>
<center style="color:#ffffff;font-family:sans-serif;font-size:15px;">{!! trans('cachet.subscriber.email.manage') !!}</center>
</v:roundrect><![endif]-->
<a href="{{ $manage_link }}" class="button button--green">{!! trans('cachet.subscriber.email.manage') !!}</a>
</div>
</td>
</tr>
</table>
<table class="body-sub" align="center">
<tr>
<td align="center">
<p class="sub"><a href="{{ $unsubscribe_link }}">{!! trans('cachet.subscriber.email.unsubscribe') !!}</a></p>
</td>
</tr>
</table>
@stop
@@ -1,17 +0,0 @@
{!! $name !!}
{!! $status !!}
{!! $text_content !!}
{!! $timestamp !!}
@if($has_component)
({{ $component_name }})
@endif
{!! trans('cachet.subscriber.email.manage') !!} {{ $manage_link }}
{!! trans('cachet.subscriber.email.unsuscribe') !!} {{ $unsubscribe_link }}
@if($show_support)
{!! trans('cachet.powered_by', ['app' => $app_name]) !!}
@endif
@@ -1,20 +0,0 @@
@extends('layout.emails')
@section('content')
{!! trans('cachet.subscriber.email.verify.html', ['app_name' => $app_name]) !!}
<table class="body-action" align="center" width="100%" cellpadding="0" cellspacing="0">
<tr>
<td align="center">
<div>
<!--[if mso]><v:roundrect xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w="urn:schemas-microsoft-com:office:word" href="{{ $link }}" style="height:45px;v-text-anchor:middle;width:200px;" arcsize="7%" stroke="f" fill="t">
<v:fill type="tile" color="#22BC66" />
<w:anchorlock/>
<center style="color:#ffffff;font-family:sans-serif;font-size:15px;">{{ trans('cachet.subscriber.email.verify.button') }}</center>
</v:roundrect><![endif]-->
<a href="{{ $link }}" class="button button--green">{{ trans('cachet.subscriber.email.verify.button') }}</a>
</div>
</td>
</tr>
</table>
@stop
@@ -1,5 +0,0 @@
{{ trans('cachet.subscriber.email.verify.text', ['app_name' => $app_name, 'link' => $link]) }}
@if($show_support)
{!! trans('cachet.powered_by', ['app' => $app_name]) !!}
@endif
@@ -1,5 +0,0 @@
@extends('layout.emails')
@section('content')
{{ trans('dashboard.settings.mail.email.body') }}
@stop
@@ -1,5 +0,0 @@
{{ trans('dashboard.settings.mail.email.body') }}
@if($show_support)
{!! trans('cachet.powered_by', ['app' => $app_name]) !!}
@endif
@@ -1,5 +0,0 @@
@extends('layout.emails')
@section('content')
{!! trans('cachet.users.email.invite.html', ['app_name' => $app_name, 'link' => $link]) !!}
@stop
@@ -1,5 +0,0 @@
{{ trans('cachet.users.email.invite.text', ['app_name' => $app_name, 'link' => $link]) }}
@if($show_support)
{!! trans('cachet.powered_by', ['app' => $app_name]) !!}
@endif