mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
Add former email address for rollbacks
This commit is contained in:
parent
ce5338dbdf
commit
4b1030f881
@ -378,11 +378,12 @@ class UserController extends BaseController
|
||||
$new_user = $this->user_repo->save($request->all(), $user);
|
||||
$new_user = $user->fresh();
|
||||
|
||||
|
||||
nlog($old_user);
|
||||
|
||||
if ($old_user_email != $new_email)
|
||||
/* When changing email address we store the former email in case we need to rollback */
|
||||
if ($old_user_email != $new_email) {
|
||||
$user->last_confirmed_email_address = $old_user_email;
|
||||
$user->save();
|
||||
UserEmailChanged::dispatch($new_user, json_decode($old_user), auth()->user()->company());
|
||||
}
|
||||
|
||||
|
||||
if(
|
||||
|
@ -1,32 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Mail\Invoices;
|
||||
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Mail\Mailable;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
class InvoiceWasPaid extends Mailable
|
||||
{
|
||||
// use Queueable, SerializesModels;
|
||||
|
||||
/**
|
||||
* Create a new message instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Build the message.
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function build()
|
||||
{
|
||||
return $this->from(config('mail.from.address'), config('mail.from.name'))->view('email.invoices.paid');
|
||||
}
|
||||
}
|
@ -1,32 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Mail\Quote;
|
||||
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Mail\Mailable;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
class QuoteWasApproved extends Mailable
|
||||
{
|
||||
// use Queueable, SerializesModels;
|
||||
|
||||
/**
|
||||
* Create a new message instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Build the message.
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function build()
|
||||
{
|
||||
return $this->from(config('mail.from.address'), config('mail.from.name'))->view('email.quotes.approved');
|
||||
}
|
||||
}
|
@ -58,6 +58,7 @@ class UserTransformer extends EntityTransformer
|
||||
'custom_value3' => $user->custom_value3 ?: '',
|
||||
'custom_value4' => $user->custom_value4 ?: '',
|
||||
'oauth_provider_id' => (string) $user->oauth_provider_id,
|
||||
'last_confirmed_email_address' => (string) $user->last_confirmed_email_address ?: '',
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class EmailLastConfirmedEmailAddressUsersTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('users', function(Blueprint $table){
|
||||
$table->string('last_confirmed_email_address')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user