From 013a2103dd7e8fa4716d5deb9325274e15f54c97 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Mon, 10 Mar 2014 23:55:56 +0200 Subject: [PATCH] bug fixes --- app/config/packages/zizaco/confide/config.php | 4 ++-- app/controllers/AccountController.php | 8 +++++++- app/ninja/mailers/UserMailer.php | 17 +++++++++++++++++ app/views/emails/confirm_text.blade.php | 6 ++++++ public/css/style.css | 2 +- 5 files changed, 33 insertions(+), 4 deletions(-) create mode 100755 app/views/emails/confirm_text.blade.php diff --git a/app/config/packages/zizaco/confide/config.php b/app/config/packages/zizaco/confide/config.php index 2e60fdad1c63..e26ae0a94eab 100755 --- a/app/config/packages/zizaco/confide/config.php +++ b/app/config/packages/zizaco/confide/config.php @@ -111,7 +111,7 @@ return array( | table, otherwise they will not be able to login after the payment. | */ - 'signup_email' => true, - 'signup_confirm' => true, + 'signup_email' => false, + 'signup_confirm' => false, ); diff --git a/app/controllers/AccountController.php b/app/controllers/AccountController.php index d9d673f753a7..eae0d6923bfb 100755 --- a/app/controllers/AccountController.php +++ b/app/controllers/AccountController.php @@ -1,16 +1,19 @@ accountRepo = $accountRepo; + $this->mailer = $mailer; } public function getStarted() @@ -571,11 +574,14 @@ class AccountController extends \BaseController { $user->first_name = trim(Input::get('new_first_name')); $user->last_name = trim(Input::get('new_last_name')); $user->email = trim(strtolower(Input::get('new_email'))); + $user->username = $user->email; $user->password = trim(Input::get('new_password')); $user->password_confirmation = trim(Input::get('new_password')); $user->registered = true; $user->amend(); + $this->mailer->sendConfirmation($user); + $activities = Activity::scope()->get(); foreach ($activities as $activity) { diff --git a/app/ninja/mailers/UserMailer.php b/app/ninja/mailers/UserMailer.php index d4037be6608a..2ed34b9bb6d1 100755 --- a/app/ninja/mailers/UserMailer.php +++ b/app/ninja/mailers/UserMailer.php @@ -8,6 +8,23 @@ use Utils; class UserMailer extends Mailer { + public function sendConfirmation(User $user) + { + if (!$user->email) + { + return; + } + + $view = 'confirm'; + $subject = 'Invoice Ninja Account Confirmation'; + + $data = [ + 'user' => $user + ]; + + $this->sendTo($user->email, CONTACT_EMAIL, $subject, $view, $data); + } + public function sendNotification(User $user, Invoice $invoice, $type, Payment $payment = null) { if (!$user->email) diff --git a/app/views/emails/confirm_text.blade.php b/app/views/emails/confirm_text.blade.php new file mode 100755 index 000000000000..e21261708ecb --- /dev/null +++ b/app/views/emails/confirm_text.blade.php @@ -0,0 +1,6 @@ +{{ Lang::get('confide::confide.email.account_confirmation.subject') }} + +{{ Lang::get('confide::confide.email.account_confirmation.body') }} +{{{ URL::to("user/confirm/{$user->confirmation_code}") }}} + +{{ Lang::get('confide::confide.email.account_confirmation.farewell') }} \ No newline at end of file diff --git a/public/css/style.css b/public/css/style.css index 0be98f592656..088456fafd0c 100755 --- a/public/css/style.css +++ b/public/css/style.css @@ -223,7 +223,7 @@ margin-left: 10px !important; /*new*/ div { - word-break: break-all; + word-break: break-word; } div.required > label {