2024-03-28 18:14:30 +01:00
|
|
|
<template>
|
2024-04-15 19:39:03 +02:00
|
|
|
<IntegrationWrapper
|
|
|
|
|
v-model="props.integrationData"
|
|
|
|
|
:integration="props.integration"
|
|
|
|
|
:form="form"
|
|
|
|
|
>
|
2024-09-24 12:16:20 +02:00
|
|
|
<p class="text-gray-500 text-sm mb-3">
|
|
|
|
|
You can <NuxtLink
|
|
|
|
|
class="underline"
|
|
|
|
|
:to="{ name: 'settings-workspace' }"
|
|
|
|
|
target="_blank"
|
|
|
|
|
>
|
|
|
|
|
use our custom SMTP feature
|
|
|
|
|
</NuxtLink> to send emails from your own domain.
|
|
|
|
|
</p>
|
|
|
|
|
|
2024-10-22 10:34:29 +02:00
|
|
|
<MentionInput
|
2024-04-15 19:39:03 +02:00
|
|
|
:form="integrationData"
|
2024-10-22 10:34:29 +02:00
|
|
|
:mentions="form.properties"
|
|
|
|
|
:disable-mention="!form.is_pro"
|
|
|
|
|
name="settings.send_to"
|
2024-04-15 19:39:03 +02:00
|
|
|
required
|
2024-10-22 10:34:29 +02:00
|
|
|
label="Send To"
|
2024-04-15 19:39:03 +02:00
|
|
|
help="Add one email per line"
|
2024-10-22 10:34:29 +02:00
|
|
|
/>
|
|
|
|
|
<div class="flex space-x-4">
|
|
|
|
|
<text-input
|
|
|
|
|
:form="integrationData"
|
|
|
|
|
name="settings.sender_name"
|
|
|
|
|
label="Sender Name"
|
|
|
|
|
class="flex-1"
|
|
|
|
|
/>
|
|
|
|
|
<text-input
|
|
|
|
|
v-if="selfHosted"
|
|
|
|
|
:form="integrationData"
|
|
|
|
|
name="settings.sender_email"
|
|
|
|
|
label="Sender Email"
|
|
|
|
|
help="If supported by email provider - default otherwise"
|
|
|
|
|
class="flex-1"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
<MentionInput
|
|
|
|
|
:form="integrationData"
|
|
|
|
|
:mentions="form.properties"
|
|
|
|
|
required
|
|
|
|
|
name="settings.subject"
|
|
|
|
|
label="Subject"
|
2024-04-15 19:39:03 +02:00
|
|
|
/>
|
2024-10-22 10:34:29 +02:00
|
|
|
<rich-text-area-input
|
2024-04-15 19:39:03 +02:00
|
|
|
:form="integrationData"
|
2024-10-22 10:34:29 +02:00
|
|
|
:enable-mentions="true"
|
|
|
|
|
:mentions="form.properties"
|
|
|
|
|
name="settings.email_content"
|
|
|
|
|
label="Email Content"
|
|
|
|
|
/>
|
|
|
|
|
<toggle-switch-input
|
|
|
|
|
:form="integrationData"
|
|
|
|
|
name="settings.include_submission_data"
|
|
|
|
|
class="mt-4"
|
|
|
|
|
label="Include submission data"
|
|
|
|
|
help="If enabled the email will contain form submission answers"
|
|
|
|
|
/>
|
|
|
|
|
<toggle-switch-input
|
|
|
|
|
v-if="integrationData.settings.include_submission_data"
|
|
|
|
|
:form="integrationData"
|
|
|
|
|
name="settings.include_hidden_fields_submission_data"
|
|
|
|
|
class="mt-4"
|
|
|
|
|
label="Include hidden fields"
|
|
|
|
|
help="If enabled the email will contain hidden fields"
|
|
|
|
|
/>
|
|
|
|
|
<MentionInput
|
|
|
|
|
:form="integrationData"
|
|
|
|
|
:mentions="form.properties"
|
|
|
|
|
name="settings.reply_to"
|
|
|
|
|
label="Reply To"
|
|
|
|
|
help="If empty, Reply-to will be your own email."
|
2024-04-15 19:39:03 +02:00
|
|
|
/>
|
2024-03-28 18:14:30 +01:00
|
|
|
</IntegrationWrapper>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script setup>
|
2024-04-15 19:39:03 +02:00
|
|
|
import IntegrationWrapper from "./components/IntegrationWrapper.vue"
|
2024-03-28 18:14:30 +01:00
|
|
|
|
|
|
|
|
const props = defineProps({
|
|
|
|
|
integration: { type: Object, required: true },
|
|
|
|
|
form: { type: Object, required: true },
|
|
|
|
|
integrationData: { type: Object, required: true },
|
2024-04-15 19:39:03 +02:00
|
|
|
formIntegrationId: { type: Number, required: false, default: null },
|
2024-03-28 18:14:30 +01:00
|
|
|
})
|
|
|
|
|
|
2024-10-22 10:34:29 +02:00
|
|
|
const selfHosted = computed(() => useFeatureFlag('self_hosted'))
|
2024-03-28 18:14:30 +01:00
|
|
|
|
2024-10-22 10:34:29 +02:00
|
|
|
onBeforeMount(() => {
|
|
|
|
|
for (const [keyname, defaultValue] of Object.entries({
|
|
|
|
|
sender_name: "OpnForm",
|
|
|
|
|
subject: "We saved your answers",
|
|
|
|
|
email_content: "Hello there 👋 <br>This is a confirmation that your submission was successfully saved.",
|
|
|
|
|
include_submission_data: true,
|
|
|
|
|
include_hidden_fields_submission_data: false,
|
|
|
|
|
})) {
|
|
|
|
|
if (props.integrationData.settings[keyname] === undefined) {
|
|
|
|
|
props.integrationData.settings[keyname] = defaultValue
|
|
|
|
|
}
|
2024-03-28 18:14:30 +01:00
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
</script>
|