Slack-Discord extra feature (#176)

* Enable Pro plan - WIP

* no pricing page if have no paid plans

* Set pricing ids in env

* views & submissions FREE for all

* extra param for env

* form password FREE for all

* Custom Code is PRO feature

* Replace codeinput prism with codemirror

* Better form Cleaning message

* Added risky user email spam protection

* fix form cleaning

* Custom SEO

* fix custom seo formcleaner

* Better webhooks

* Slack-Discord extra feature

* fix conflict
This commit is contained in:
formsdev
2023-08-30 17:50:14 +05:30
committed by GitHub
parent 057bfde8b7
commit 662088e20f
12 changed files with 248 additions and 111 deletions

View File

@@ -28,23 +28,29 @@
<toggle-switch-input name="notifies_discord" :form="form" class="mt-4"
label="Receive a Discord notification on submission"
/>
<text-input v-if="form.notifies_discord" name="discord_webhook_url" :form="form" class="mt-4"
label="Discord webhook url" help="help"
>
<template #help>
Receive a discord message on each form submission.
<a href="https://support.discord.com/hc/en-us/articles/228383668-Intro-to-Webhooks" target="_blank">Click here</a> to learn how to get a discord webhook url.
</template>
</text-input>
<template v-if="form.notifies_discord">
<text-input name="discord_webhook_url" :form="form" class="mt-4"
label="Discord webhook url" help="help"
>
<template #help>
Receive a discord message on each form submission.
<a href="https://support.discord.com/hc/en-us/articles/228383668-Intro-to-Webhooks" target="_blank">Click
here</a> to learn how to get a discord webhook url.
</template>
</text-input>
<h4 class="font-bold mt-4">Discord message actions</h4>
<form-notifications-message-actions v-model="form.notification_settings.discord" />
</template>
</modal>
</div>
</template>
<script>
import ProTag from '../../../../../common/ProTag.vue'
import FormNotificationsMessageActions from './FormNotificationsMessageActions.vue'
export default {
components: { ProTag },
components: { ProTag, FormNotificationsMessageActions },
props: {},
data () {
return {

View File

@@ -0,0 +1,64 @@
<template>
<div>
<toggle-switch-input name="include_submission_data" v-model="compVal.include_submission_data" class="mt-4"
label="Include submission data"
help="With form submission answers"
/>
<toggle-switch-input name="link_open_form" v-model="compVal.link_open_form" class="mt-4"
label="Open Form"
help="Link to the form public page"
/>
<toggle-switch-input name="link_edit_form" v-model="compVal.link_edit_form" class="mt-4"
label="Edit Form"
help="Link to the form admin page"
/>
<toggle-switch-input name="views_submissions_count" v-model="compVal.views_submissions_count" class="mt-4"
label="Analytics (views & submissions)"
/>
<toggle-switch-input name="link_edit_submission" v-model="compVal.link_edit_submission" class="mt-4"
label="Link to the Edit Submission Record"
/>
</div>
</template>
<script>
export default {
name: 'FormNotificationsMessageActions',
components: { },
props: {
value: { required: false }
},
data () {
return {
content: this.value
}
},
computed: {
compVal: {
set (val) {
this.content = val
this.$emit('input', this.compVal)
},
get () {
return this.content
}
}
},
watch: {},
mounted () {
if(this.compVal === undefined || this.compVal === null){
this.compVal = {}
}
['include_submission_data', 'link_open_form', 'link_edit_form', 'views_submissions_count', 'link_edit_submission'].forEach((keyname) => {
if (this.compVal[keyname] === undefined) {
this.compVal[keyname] = true
}
})
},
methods: { }
}
</script>

View File

@@ -28,22 +28,30 @@
<toggle-switch-input name="notifies_slack" :form="form" class="mt-4"
label="Receive a Slack notification on submission"
/>
<text-input v-if="form.notifies_slack" name="slack_webhook_url" :form="form" class="mt-4"
label="Slack webhook url" help="help"
>
<template #help>
Receive slack message on each form submission. <a href="https://api.slack.com/messaging/webhooks" target="_blank">Click here</a> to learn how to get a slack webhook url
</template>
</text-input>
<template v-if="form.notifies_slack">
<text-input name="slack_webhook_url" :form="form" class="mt-4"
label="Slack webhook url" help="help"
>
<template #help>
Receive slack message on each form submission. <a href="https://api.slack.com/messaging/webhooks"
target="_blank"
>Click here</a> to learn how to get a slack
webhook url
</template>
</text-input>
<h4 class="font-bold mt-4">Slack message actions</h4>
<form-notifications-message-actions v-model="form.notification_settings.slack" />
</template>
</modal>
</div>
</template>
<script>
import ProTag from '../../../../../common/ProTag.vue'
import FormNotificationsMessageActions from './FormNotificationsMessageActions.vue'
export default {
components: { ProTag },
components: { ProTag, FormNotificationsMessageActions },
props: {},
data () {
return {

View File

@@ -14,6 +14,7 @@ export default {
slack_notifies: false,
send_submission_confirmation: false,
webhook_url: null,
notification_settings: {},
// Customization
theme: 'default',