From db560ae665936d3e7254ff4620a98cd5e43ea2e9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Phil=20H=C3=B6fer?= <phil@suma-ev.de>
Date: Fri, 27 Nov 2020 10:53:33 +0000
Subject: [PATCH] Integrate New Donation Page Into MailController

---
 app/Http/Controllers/MailController.php | 5 ++++-
 resources/lang/de/spende.php            | 2 ++
 resources/lang/en/spende.php            | 3 +++
 resources/views/spende/danke.blade.php  | 4 ++++
 4 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/app/Http/Controllers/MailController.php b/app/Http/Controllers/MailController.php
index 86afc3ceb..2d049524c 100644
--- a/app/Http/Controllers/MailController.php
+++ b/app/Http/Controllers/MailController.php
@@ -83,13 +83,15 @@ class MailController extends Controller
             'iban' => $request->input('iban', ''),
             'bic' => $request->input('bic', ''),
             'email' => $request->input('email', ''),
-            'betrag' => $request->input('Betrag', ''),
+            'betrag' => $request->input('amount', ''),
+            'betrag' => $request->input('frequency', ''),
             'nachricht' => $request->input('Nachricht', ''),
         ];
         $name = $request->input('Name', '');
         $iban = $request->input('iban', '');
         $bic = $request->input('bic', '');
         $email = $request->input('email', '');
+        $frequency = $request->input('frequency', '');
         $betrag = $request->input('Betrag', '');
         $nachricht = $request->input('Nachricht', '');
 
@@ -140,6 +142,7 @@ class MailController extends Controller
             }
 
             $message .= "\r\nBetrag: " . $betrag;
+            $message .= "\r\nHäufigkeit: " . $frequency;
             $message .= "\r\nNachricht: " . $nachricht;
 
             try {
diff --git a/resources/lang/de/spende.php b/resources/lang/de/spende.php
index 82794c008..4b7195945 100644
--- a/resources/lang/de/spende.php
+++ b/resources/lang/de/spende.php
@@ -11,6 +11,8 @@ return [
 
     'wunschbetrag' => 'Wunschbetrag',
 
+    'frequency' => 'Häufigkeit',
+
     'frequency.1' => 'Einmalig',
     'frequency.2' => 'Monatlich',
     'frequency.3' => 'Vierteljährlich',
diff --git a/resources/lang/en/spende.php b/resources/lang/en/spende.php
index c990921ab..366bc9c9d 100644
--- a/resources/lang/en/spende.php
+++ b/resources/lang/en/spende.php
@@ -13,6 +13,9 @@ return [
 
     'wunschbetrag' => 'Custom amount',
 
+
+    'frequency' => 'Frequency',
+
     'frequency.1' => 'Once',
     'frequency.2' => 'Monthly',
     'frequency.3' => 'Quarterly',
diff --git a/resources/views/spende/danke.blade.php b/resources/views/spende/danke.blade.php
index 436dd1bc6..961a1d396 100644
--- a/resources/views/spende/danke.blade.php
+++ b/resources/views/spende/danke.blade.php
@@ -32,6 +32,10 @@
 						<td>{{ trans('spende.betrag') }}</td>
 						<td>{{ $data['betrag'] }} €</td>
 					</tr>
+					<tr>
+						<td>{{ trans('spende.frequency') }}</td>
+						<td>{{ $data['frequency'] }} €</td>
+					</tr>
 					<tr>
 						<td>{{ trans('spende.danke.message') }}</td>
 						<td>{{ $data['nachricht'] }}</td>
-- 
GitLab