diff --git a/app/Space/EnvironmentManager.php b/app/Space/EnvironmentManager.php index 4f1bd799..456a0e0f 100755 --- a/app/Space/EnvironmentManager.php +++ b/app/Space/EnvironmentManager.php @@ -96,7 +96,7 @@ class EnvironmentManager { $mailData = $this->getMailData($request); - + dd($mailData); try { file_put_contents($this->envPath, str_replace( @@ -132,6 +132,10 @@ class EnvironmentManager 'MAIL_USERNAME='.config('mail.username')."\n". 'MAIL_PASSWORD='.config('mail.password')."\n"; + $resetCredential = + 'MAIL_USERNAME='."\n". + 'MAIL_PASSWORD='."\n"; + switch ($request->mail_driver) { case 'smtp': $mailCredential= @@ -140,7 +144,7 @@ class EnvironmentManager break; case 'mailgun': - $mailCredential = $oldMailCredential; + $mailCredential = $resetCredential; $otherCredential= 'MAILGUN_DOMAIN='.$request->mail_mailgun_domain."\n". 'MAILGUN_SECRET='.$request->mail_mailgun_secret."\n". @@ -156,7 +160,7 @@ class EnvironmentManager break; case 'sparkpost': - $mailCredential = $oldMailCredential; + $mailCredential = $resetCredential; $otherCredential= 'SPARKPOST_SECRET='.$request->mail_sparkpost_secret."\n\n"; @@ -167,7 +171,7 @@ class EnvironmentManager break; case 'ses': - $mailCredential = $oldMailCredential; + $mailCredential = $resetCredential; $otherCredential= 'SES_KEY='.$request->mail_ses_key."\n". 'SES_SECRET='.$request->mail_ses_secret."\n\n"; @@ -183,7 +187,7 @@ class EnvironmentManager $existMailData = 'MAIL_DRIVER='.$request->mail_driver."\n". 'MAIL_HOST='.config('mail.host')."\n". 'MAIL_PORT='.config('mail.port')."\n". - $oldMailCredential. + $resetCredential. 'MAIL_ENCRYPTION='.config('mail.encryption')."\n\n". 'MAIL_FROM_ADDRESS='.$request->from_mail."\n". 'MAIL_FROM_NAME='.$request->from_name."\n\n". @@ -194,7 +198,7 @@ class EnvironmentManager $existMailData = 'MAIL_DRIVER='.$request->mail_driver."\n". 'MAIL_HOST='.config('mail.host')."\n". 'MAIL_PORT='.config('mail.port')."\n". - $oldMailCredential. + $resetCredential. 'MAIL_ENCRYPTION='.config('mail.encryption')."\n\n". 'MAIL_FROM_ADDRESS='.$request->from_mail."\n". 'MAIL_FROM_NAME='.$request->from_name."\n\n". @@ -211,11 +215,6 @@ class EnvironmentManager 'MANDRILL_API_KEY='.config('services.mandrill.secret')."\n\n"; } break; - - default: - $mailCredential = "\n"; - $otherCredential = "\n"; - break; } $oldMailData = diff --git a/resources/assets/js/plugins/en.js b/resources/assets/js/plugins/en.js index 9b56b1f3..9358b746 100644 --- a/resources/assets/js/plugins/en.js +++ b/resources/assets/js/plugins/en.js @@ -743,9 +743,19 @@ export default { host: 'Mail Host', port: 'Mail Port', driver: 'Mail Driver', + domain: 'Domain', + secret: 'Secret', + sparkpost_secret: 'Sparkpost Secret', + mailgin_secret: 'Mailgun Secret', + ses_secret: 'SES Secret', + mandrill_secret: 'Mandrill Secret', + ses_key: 'SES Key', password: 'Mail Password', username: 'Mail Username', + endpoint: 'Mail Endpoint', mail_config: 'Mail Configuration', + from_name: 'From Mail Name', + from_mail: 'From Mail Address', encryption: 'Mail Encryption', mail_config_desc: 'Below details will be used to update the mail environment. Also you can change the details anytime after logging in.' }, diff --git a/resources/assets/js/views/settings/mailDriver/Basic.vue b/resources/assets/js/views/settings/mailDriver/Basic.vue index bb265378..2d4f4b84 100644 --- a/resources/assets/js/views/settings/mailDriver/Basic.vue +++ b/resources/assets/js/views/settings/mailDriver/Basic.vue @@ -2,7 +2,7 @@
- + *
+
+
+
+ + * + +
+ + {{ $tc('validation.required') }} + +
+
+
+ + * + +
+ + {{ $tc('validation.required') }} + +
+
+
+ + {{ $t('general.save') }} + +
+ + diff --git a/resources/assets/js/views/wizard/mailDriver/Mailgun.vue b/resources/assets/js/views/wizard/mailDriver/Mailgun.vue new file mode 100644 index 00000000..a6fa165c --- /dev/null +++ b/resources/assets/js/views/wizard/mailDriver/Mailgun.vue @@ -0,0 +1,278 @@ + + diff --git a/resources/assets/js/views/wizard/mailDriver/Mandrill.vue b/resources/assets/js/views/wizard/mailDriver/Mandrill.vue new file mode 100644 index 00000000..c7a60a59 --- /dev/null +++ b/resources/assets/js/views/wizard/mailDriver/Mandrill.vue @@ -0,0 +1,230 @@ + + diff --git a/resources/assets/js/views/wizard/mailDriver/Ses.vue b/resources/assets/js/views/wizard/mailDriver/Ses.vue new file mode 100644 index 00000000..9733fe1e --- /dev/null +++ b/resources/assets/js/views/wizard/mailDriver/Ses.vue @@ -0,0 +1,253 @@ + + diff --git a/resources/assets/js/views/wizard/mailDriver/Smtp.vue b/resources/assets/js/views/wizard/mailDriver/Smtp.vue new file mode 100644 index 00000000..8bbea8d9 --- /dev/null +++ b/resources/assets/js/views/wizard/mailDriver/Smtp.vue @@ -0,0 +1,253 @@ + + diff --git a/resources/assets/js/views/wizard/mailDriver/Sparkpost.vue b/resources/assets/js/views/wizard/mailDriver/Sparkpost.vue new file mode 100644 index 00000000..ae08d2ba --- /dev/null +++ b/resources/assets/js/views/wizard/mailDriver/Sparkpost.vue @@ -0,0 +1,233 @@ + +