Added support for gmail one-click actions

This commit is contained in:
Hillel Coren 2015-03-11 23:37:43 +02:00
parent 228f772f02
commit 2cdf6d517a
9 changed files with 197 additions and 159 deletions

View File

@ -41,6 +41,8 @@ class ContactMailer extends Mailer
];
$data['body'] = str_replace(array_keys($variables), array_values($variables), $emailTemplate);
$data['link'] = $invitation->getLink();
$data['entityType'] = $entityType;
$fromEmail = $invitation->user->email;
$this->sendTo($invitation->contact->email, $fromEmail, $accountName, $subject, $view, $data);

View File

@ -8,9 +8,13 @@
<div class="panel-body">
<img src="{{ asset('images/totalincome.png') }}" class="in-image"/>
<div class="in-bold">
@if (count($paidToDate))
@foreach ($paidToDate as $item)
{{ Utils::formatMoney($item->value, $item->currency_id); }}<br/>
@endforeach
@else
{{ Utils::formatMoney(0) }}
@endif
</div>
<div class="in-thin">
{{ trans('texts.in_total_revenue') }}

View File

@ -1,6 +1,7 @@
<html>
<body>
<script type="application/ld+json">
<body>
@if (!$invitationMessage)
<script type="application/ld+json">
{
"@context":"http://schema.org",
"@type":"EmailMessage",
@ -8,18 +9,24 @@
"action":
{
"@type":"ConfirmAction",
"name":"Confirm Account",
"name":"Confirm account",
"handler": {
"@type": "HttpActionHandler",
"url": "{{{ URL::to("user/confirm/{$user->confirmation_code}") }}}"
},
"publisher": {
"@type": "Organization",
"name": "Invoice Ninja",
"url": "{{{ NINJA_WEB_URL }}}"
}
}
}
</script>
</script>
@endif
<h1>{{ trans('texts.confirmation_header') }}</h1>
<h1>{{ trans('texts.confirmation_header') }}</h1>
<p>
<p>
{{ $invitationMessage . trans('texts.confirmation_message') }}<br/>
<a href='{{{ URL::to("user/confirm/{$user->confirmation_code}") }}}'>
{{{ URL::to("user/confirm/{$user->confirmation_code}") }}}
@ -28,6 +35,7 @@
{{ trans('texts.email_signature') }}<br/>
{{ trans('texts.email_from') }}
</p>
</body>
</body>
</html>

View File

@ -1,7 +1,10 @@
<!DOCTYPE html>
<html>
<head>
<head>
<meta charset="utf-8">
</head>
<body>{{ $body }}</body>
</head>
<body>
@include('emails.view_action', ['link' => $link, 'entityType' => $entityType])
{{ $body }}
</body>
</html>

View File

@ -4,7 +4,7 @@
<meta charset="utf-8">
</head>
<body>
@include('emails.view_action', ['link' => $invoiceLink, 'entityType' => $entityType])
{{ trans('texts.email_salutation', ['name' => $userName]) }} <p/>
{{ trans("texts.notification_{$entityType}_paid", ['amount' => $paymentAmount, 'client' => $clientName, 'invoice' => $invoiceNumber]) }} <p/>

View File

@ -4,7 +4,7 @@
<meta charset="utf-8">
</head>
<body>
@include('emails.view_action', ['link' => $invoiceLink, 'entityType' => $entityType])
{{ trans('texts.email_salutation', ['name' => $userName]) }} <p/>
{{ trans("texts.notification_{$entityType}_sent", ['amount' => $invoiceAmount, 'client' => $clientName, 'invoice' => $invoiceNumber]) }} <p/>

View File

@ -4,7 +4,7 @@
<meta charset="utf-8">
</head>
<body>
@include('emails.view_action', ['link' => $invoiceLink, 'entityType' => $entityType])
{{ trans('texts.email_salutation', ['name' => $userName]) }} <p/>
{{ trans("texts.notification_{$entityType}_viewed", ['amount' => $invoiceAmount, 'client' => $clientName, 'invoice' => $invoiceNumber]) }} <p/>

View File

@ -0,0 +1,17 @@
<script type="application/ld+json">
{
"@context":"http://schema.org",
"@type":"EmailMessage",
"description":"View your {{ $entityType }}",
"action": {
"@type": "ViewAction",
"url": "{{{ $link }}}",
"name": "View {{ $entityType }}"
},
"publisher": {
"@type": "Organization",
"name": "Invoice Ninja",
"url": "{{{ NINJA_WEB_URL }}}"
}
}
</script>

View File

@ -366,6 +366,10 @@ Want something changed? We're {{ link_to('https://github.com/hillelcoren/invoice
<div class="modal-footer" id="signUpFooter" style="margin-top: 0px">
<button type="button" class="btn btn-default" data-dismiss="modal">{{ trans('texts.close') }} </button>
{{-- DropdownButton::success_lg(trans('texts.buy'), [
['url' => URL::to(""), 'label' => trans('texts.pay_with_paypal')],
['url' => URL::to(""), 'label' => trans('texts.pay_with_card')]
])->addClass('btn-lg') --}}
<button type="button" class="btn btn-primary" onclick="buyProduct('{{ WHITE_LABEL_AFFILIATE_KEY }}', '{{ PRODUCT_WHITE_LABEL }}')">{{ trans('texts.buy') }} </button>
</div>
</div>