diff --git a/packages/Webkul/Admin/src/Mail/NewCustomerNotification.php b/packages/Webkul/Admin/src/Mail/NewCustomerNotification.php
index b4e47718d..4af9308e6 100644
--- a/packages/Webkul/Admin/src/Mail/NewCustomerNotification.php
+++ b/packages/Webkul/Admin/src/Mail/NewCustomerNotification.php
@@ -51,7 +51,7 @@ class NewCustomerNotification extends Mailable
public function build()
{
return $this->to($this->customer->email)
- ->subject(trans('shop::app.mail.customer.subject'))
+ ->subject(trans('shop::app.mail.customer.new.subject'))
->view('shop::emails.customer.new-customer')->with(['customer' => $this->customer, 'password' => $this->password]);
}
}
\ No newline at end of file
diff --git a/packages/Webkul/Customer/src/Http/Controllers/CustomerController.php b/packages/Webkul/Customer/src/Http/Controllers/CustomerController.php
index 14c36e819..30d407510 100755
--- a/packages/Webkul/Customer/src/Http/Controllers/CustomerController.php
+++ b/packages/Webkul/Customer/src/Http/Controllers/CustomerController.php
@@ -133,6 +133,32 @@ class CustomerController extends Controller
}
}
+ /**
+ * Remove the specified resource from storage.
+ *
+ * @param int $id
+ * @return \Illuminate\Http\Response
+ */
+ public function destroy($id)
+ {
+ $id = auth()->guard('customer')->user()->id;
+
+ $customer = $this->customer->findorFail($id);
+
+ try {
+ $this->customer->delete($id);
+
+ session()->flash('success', trans('admin::app.response.delete-success', ['name' => 'Customer']));
+
+ return redirect()->route($this->_config['redirect']);
+ } catch(\Exception $e) {
+ session()->flash('error', trans('admin::app.response.delete-failed', ['name' => 'Customer']));
+
+ return redirect()->route($this->_config['redirect']);
+ }
+ }
+
+
/**
* Load the view for the customer account panel, showing approved reviews.
*
diff --git a/packages/Webkul/Customer/src/Http/Controllers/RegistrationController.php b/packages/Webkul/Customer/src/Http/Controllers/RegistrationController.php
index 53c72926f..d0a0e195b 100755
--- a/packages/Webkul/Customer/src/Http/Controllers/RegistrationController.php
+++ b/packages/Webkul/Customer/src/Http/Controllers/RegistrationController.php
@@ -6,6 +6,7 @@ use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Illuminate\Support\Facades\Event;
use Illuminate\Support\Facades\Mail;
+use Webkul\Customer\Mail\RegistrationEmail;
use Webkul\Customer\Mail\VerificationEmail;
use Illuminate\Routing\Controller;
use Webkul\Customer\Repositories\CustomerRepository;
@@ -97,6 +98,15 @@ class RegistrationController extends Controller
session()->flash('info', trans('shop::app.customer.signup-form.success-verify-email-unsent'));
}
} else {
+ try {
+ Mail::queue(new RegistrationEmail(request()->all()));
+
+ session()->flash('success', trans('shop::app.customer.signup-form.success-verify')); //customer registered successfully
+ } catch (\Exception $e) {
+ session()->flash('info', trans('shop::app.customer.signup-form.success-verify-email-unsent'));
+ }
+
+
session()->flash('success', trans('shop::app.customer.signup-form.success'));
}
diff --git a/packages/Webkul/Customer/src/Mail/RegistrationEmail.php b/packages/Webkul/Customer/src/Mail/RegistrationEmail.php
new file mode 100644
index 000000000..ffd045e90
--- /dev/null
+++ b/packages/Webkul/Customer/src/Mail/RegistrationEmail.php
@@ -0,0 +1,38 @@
+data = $data;
+ }
+
+ /**
+ * Build the message.
+ *
+ * @return $this
+ */
+ public function build()
+ {
+ return $this->to($this->data['email'])
+ ->from(env('SHOP_MAIL_FROM'))
+ ->subject(trans('shop::app.mail.customer.registration.customer-registration'))
+ ->view('shop::emails.customer.registration')->with('data', $this->data);
+ }
+}
\ No newline at end of file
diff --git a/packages/Webkul/Customer/src/Mail/VerificationEmail.php b/packages/Webkul/Customer/src/Mail/VerificationEmail.php
index 41fa0bc31..73c4b6f30 100755
--- a/packages/Webkul/Customer/src/Mail/VerificationEmail.php
+++ b/packages/Webkul/Customer/src/Mail/VerificationEmail.php
@@ -32,7 +32,7 @@ class VerificationEmail extends Mailable
{
return $this->to($this->verificationData['email'])
->from(env('SHOP_MAIL_FROM'))
- ->subject('Verification email')
+ ->subject(trans('shop::app.mail.customer.verification.subject'))
->view('shop::emails.customer.verification-email')->with('data', ['email' => $this->verificationData['email'], 'token' => $this->verificationData['token']]);
}
}
\ No newline at end of file
diff --git a/packages/Webkul/Shop/src/Http/routes.php b/packages/Webkul/Shop/src/Http/routes.php
index 0d13a6783..92104e47c 100755
--- a/packages/Webkul/Shop/src/Http/routes.php
+++ b/packages/Webkul/Shop/src/Http/routes.php
@@ -210,6 +210,12 @@ Route::group(['middleware' => ['web', 'locale', 'theme', 'currency']], function
Route::post('profile/edit', 'Webkul\Customer\Http\Controllers\CustomerController@update')->defaults('_config', [
'redirect' => 'customer.profile.index'
])->name('customer.profile.edit');
+
+ //Customer Profile Delete Form Store
+ Route::post('profile/destroy', 'Webkul\Customer\Http\Controllers\CustomerController@destroy')->defaults('_config', [
+ 'redirect' => 'customer.profile.index'
+ ])->name('customer.profile.destroy');
+
/* Profile Routes Ends Here */
/* Routes for Addresses */
diff --git a/packages/Webkul/Shop/src/Mail/SubscriptionEmail.php b/packages/Webkul/Shop/src/Mail/SubscriptionEmail.php
index 2acf41474..96ba6a3e3 100755
--- a/packages/Webkul/Shop/src/Mail/SubscriptionEmail.php
+++ b/packages/Webkul/Shop/src/Mail/SubscriptionEmail.php
@@ -32,7 +32,7 @@ class SubscriptionEmail extends Mailable
{
return $this->to($this->subscriptionData['email'])
->from(env('SHOP_MAIL_FROM'))
- ->subject('subscription email')
+ ->subject(trans('shop::app.mail.customer.subscription.subject'))
->view('shop::emails.customer.subscription-email')->with('data', ['content' => 'You Are Subscribed', 'token' => $this->subscriptionData['token']]);
}
}
\ No newline at end of file
diff --git a/packages/Webkul/Shop/src/Resources/lang/en/app.php b/packages/Webkul/Shop/src/Resources/lang/en/app.php
index d496a6826..ed4e720aa 100755
--- a/packages/Webkul/Shop/src/Resources/lang/en/app.php
+++ b/packages/Webkul/Shop/src/Resources/lang/en/app.php
@@ -117,6 +117,7 @@ return [
'verified' => 'Your Account Has Been Verified, Try To Login Now',
'verify-failed' => 'We Cannot Verify Your Mail Account',
'dont-have-account' => 'You Do Not Have Account With Us',
+ 'customer-registration' => 'Customer Registered Successfully'
],
'login-text' => [
@@ -543,7 +544,40 @@ return [
'thanks' => 'Thanks!'
],
'customer' => [
- 'subject' => 'New Customer Registration'
+ 'new' => [
+ 'dear' => 'Dear :customer_name',
+ 'username-email' => 'UserName/Email',
+ 'subject' => 'New Customer Registration',
+ 'password' => 'Password',
+ 'summary' => 'Your account has been created in bagisto.
+ Your account details are below: ',
+ 'thanks' => 'Thanks!',
+ ],
+
+ 'registration' => [
+ 'subject' => 'New Customer Registration',
+ 'customer-registration' => 'Customer Registered Successfully',
+ 'dear' => 'Dear :customer_name',
+ 'greeting' => 'Welcome and thank you for registering at Bagisto!',
+ 'summary' => 'Your account has now been created successfully and you can login using your email address and password credentials. Upon logging in, you will be able to access other services including reviewing past orders, wishlists and editing your account information.',
+ 'thanks' => 'Thanks!',
+ ],
+
+ 'verification' => [
+ 'heading' => 'Bagisto - Email Verification',
+ 'subject' => 'Verification Mail',
+ 'verify' => 'Verify Your Account',
+ 'summary' => 'This is the mail to verify that the email address you entered is yours.
+ Kindly click the Verify Your Account button below to verify your account.'
+ ],
+
+ 'subscription' => [
+ 'subject' => 'Subscription Email',
+ 'greeting' => ' Welcome to Bagisto - Email Subscription',
+ 'unsubscribe' => 'Unsubscribe',
+ 'summary' => 'Thanks for putting me into your inbox. It’s been a while since you’ve read Bagisto email, and we don’t want to overwhelm your inbox. If you still do not want to receive
+ the latest email marketing news then for sure click the button below.'
+ ]
]
],
diff --git a/packages/Webkul/Shop/src/Resources/views/customers/account/profile/index.blade.php b/packages/Webkul/Shop/src/Resources/views/customers/account/profile/index.blade.php
index c6d8730ba..8bf150254 100755
--- a/packages/Webkul/Shop/src/Resources/views/customers/account/profile/index.blade.php
+++ b/packages/Webkul/Shop/src/Resources/views/customers/account/profile/index.blade.php
@@ -67,6 +67,18 @@
+
+ {{ __('shop::app.mail.customer.new.thanks') }} +
@endcomponent \ No newline at end of file diff --git a/packages/Webkul/Shop/src/Resources/views/emails/customer/registration.blade.php b/packages/Webkul/Shop/src/Resources/views/emails/customer/registration.blade.php new file mode 100644 index 000000000..1e5a67c30 --- /dev/null +++ b/packages/Webkul/Shop/src/Resources/views/emails/customer/registration.blade.php @@ -0,0 +1,32 @@ +@component('shop::emails.layouts.master') + ++ {{ __('shop::app.mail.customer.registration.dear', ['customer_name' => $data['first_name']. ' ' .$data['last_name']]) }}, +
+ ++ {!! __('shop::app.mail.customer.registration.greeting') !!} +
++ {{ __('shop::app.mail.customer.registration.thanks') }} +
+