diff --git a/app/javascript/dashboard/i18n/locale/en/inboxMgmt.json b/app/javascript/dashboard/i18n/locale/en/inboxMgmt.json index 87fe57564..a4092289e 100644 --- a/app/javascript/dashboard/i18n/locale/en/inboxMgmt.json +++ b/app/javascript/dashboard/i18n/locale/en/inboxMgmt.json @@ -381,7 +381,11 @@ "API": { "ERROR_MESSAGE": "We were not able to save the email channel" }, - "FINISH_MESSAGE": "Start forwarding your emails to the following email address." + "FINISH_MESSAGE": "Your email inbox has been created successfully! You can start forwarding your emails to the address below, or configure SMTP and IMAP credentials to send and receive emails directly.", + "FINISH_MESSAGE_NO_FORWARDING": "Your email inbox has been created successfully! You need to configure SMTP and IMAP credentials to send and receive emails. Without these settings, no emails will be processed.", + "FORWARDING_ADDRESS_LABEL": "Forward emails to this address:", + "CONFIGURE_SMTP_IMAP_LINK": "Click here", + "CONFIGURE_SMTP_IMAP_TEXT": " to configure IMAP and SMTP settings" }, "LINE_CHANNEL": { "TITLE": "LINE Channel", @@ -707,6 +711,7 @@ "INBOX_IDENTIFIER_SUB_TEXT": "Use the `inbox_identifier` token shown here to authentication your API clients.", "FORWARD_EMAIL_TITLE": "Forward to Email", "FORWARD_EMAIL_SUB_TEXT": "Start forwarding your emails to the following email address.", + "FORWARD_EMAIL_NOT_CONFIGURED": "Forwarding emails to your inbox is currently disabled on this installation. To use this feature, it must be enabled by your administrator. Please get in touch with them to proceed.", "ALLOW_MESSAGES_AFTER_RESOLVED": "Allow messages after conversation resolved", "ALLOW_MESSAGES_AFTER_RESOLVED_SUB_TEXT": "Allow the end-users to send messages even after the conversation is resolved.", "WHATSAPP_SECTION_SUBHEADER": "This API Key is used for the integration with the WhatsApp APIs.", diff --git a/app/javascript/dashboard/routes/dashboard/settings/inbox/FinishSetup.vue b/app/javascript/dashboard/routes/dashboard/settings/inbox/FinishSetup.vue index 46a189b39..ec89ec930 100644 --- a/app/javascript/dashboard/routes/dashboard/settings/inbox/FinishSetup.vue +++ b/app/javascript/dashboard/routes/dashboard/settings/inbox/FinishSetup.vue @@ -7,6 +7,7 @@ import QRCode from 'qrcode'; import EmptyState from '../../../../components/widgets/EmptyState.vue'; import NextButton from 'dashboard/components-next/button/Button.vue'; import DuplicateInboxBanner from './channels/instagram/DuplicateInboxBanner.vue'; +import EmailInboxFinish from './channels/emailChannels/EmailInboxFinish.vue'; import { useInbox } from 'dashboard/composables/useInbox'; import { INBOX_TYPES } from 'dashboard/helper/inbox'; @@ -86,10 +87,6 @@ const message = computed(() => { )}`; } - if (isAnEmailChannel.value && !currentInbox.value.provider) { - return t('INBOX_MGMT.ADD.EMAIL_CHANNEL.FINISH_MESSAGE'); - } - if (currentInbox.value.web_widget_script) { return t('INBOX_MGMT.FINISH.WEBSITE_SUCCESS'); } @@ -176,7 +173,7 @@ onMounted(() => { />
@@ -227,12 +224,11 @@ onMounted(() => { :script="currentInbox.callback_webhook_url" />
-
- -
+ :inbox="currentInbox" + :inbox-id="$route.params.inbox_id" + />
+import { computed } from 'vue'; +import { useI18n } from 'vue-i18n'; + +const props = defineProps({ + inbox: { + type: Object, + required: true, + }, + inboxId: { + type: [String, Number], + required: true, + }, +}); + +const { t } = useI18n(); + +const message = computed(() => { + return props.inbox.forwarding_enabled + ? t('INBOX_MGMT.ADD.EMAIL_CHANNEL.FINISH_MESSAGE') + : t('INBOX_MGMT.ADD.EMAIL_CHANNEL.FINISH_MESSAGE_NO_FORWARDING'); +}); + +const showForwardingAddress = computed(() => { + return props.inbox.forwarding_enabled; +}); + + + diff --git a/app/javascript/dashboard/routes/dashboard/settings/inbox/settingsPage/ConfigurationPage.vue b/app/javascript/dashboard/routes/dashboard/settings/inbox/settingsPage/ConfigurationPage.vue index 578a788cd..25f96ad3e 100644 --- a/app/javascript/dashboard/routes/dashboard/settings/inbox/settingsPage/ConfigurationPage.vue +++ b/app/javascript/dashboard/routes/dashboard/settings/inbox/settingsPage/ConfigurationPage.vue @@ -50,6 +50,9 @@ export default { whatsappAppId() { return window.chatwootConfig?.whatsappAppId; }, + isForwardingEnabled() { + return !!this.inbox.forwarding_enabled; + }, }, watch: { inbox() { @@ -300,9 +303,24 @@ export default {
- + +
+

+ {{ $t('INBOX_MGMT.SETTINGS_POPUP.FORWARD_EMAIL_NOT_CONFIGURED') }} +

+
diff --git a/app/views/api/v1/models/_inbox.json.jbuilder b/app/views/api/v1/models/_inbox.json.jbuilder index d9134d563..cf7346dde 100644 --- a/app/views/api/v1/models/_inbox.json.jbuilder +++ b/app/views/api/v1/models/_inbox.json.jbuilder @@ -74,8 +74,9 @@ end if resource.email? ## Email Channel Attributes - json.forward_to_email resource.channel.try(:forward_to_email) json.email resource.channel.try(:email) + json.forwarding_enabled ENV.fetch('MAILER_INBOUND_EMAIL_DOMAIN', '').present? + json.forward_to_email resource.channel.try(:forward_to_email) if ENV.fetch('MAILER_INBOUND_EMAIL_DOMAIN', '').present? ## IMAP if Current.account_user&.administrator?