On slack,discord add support for Include hidden fields (#654)
This commit is contained in:
@@ -15,6 +15,7 @@ class DiscordIntegration extends AbstractIntegrationHandler
|
||||
return [
|
||||
'discord_webhook_url' => 'required|url|starts_with:https://discord.com/api/webhooks',
|
||||
'include_submission_data' => 'boolean',
|
||||
'include_hidden_fields_submission_data' => ['nullable', 'boolean'],
|
||||
'link_open_form' => 'boolean',
|
||||
'link_edit_form' => 'boolean',
|
||||
'views_submissions_count' => 'boolean',
|
||||
@@ -34,10 +35,14 @@ class DiscordIntegration extends AbstractIntegrationHandler
|
||||
|
||||
protected function getWebhookData(): array
|
||||
{
|
||||
$settings = (array) $this->integrationData ?? [];
|
||||
|
||||
$formatter = (new FormSubmissionFormatter($this->form, $this->submissionData))->outputStringsOnly();
|
||||
if (Arr::get($settings, 'include_hidden_fields_submission_data', false)) {
|
||||
$formatter->showHiddenFields();
|
||||
}
|
||||
$formattedData = $formatter->getFieldsWithValue();
|
||||
|
||||
$settings = (array) $this->integrationData ?? [];
|
||||
$externalLinks = [];
|
||||
if (Arr::get($settings, 'link_open_form', true)) {
|
||||
$externalLinks[] = '[**🔗 Open Form**](' . $this->form->share_url . ')';
|
||||
|
||||
@@ -15,6 +15,7 @@ class SlackIntegration extends AbstractIntegrationHandler
|
||||
return [
|
||||
'slack_webhook_url' => 'required|url|starts_with:https://hooks.slack.com/',
|
||||
'include_submission_data' => 'boolean',
|
||||
'include_hidden_fields_submission_data' => ['nullable', 'boolean'],
|
||||
'link_open_form' => 'boolean',
|
||||
'link_edit_form' => 'boolean',
|
||||
'views_submissions_count' => 'boolean',
|
||||
@@ -34,10 +35,14 @@ class SlackIntegration extends AbstractIntegrationHandler
|
||||
|
||||
protected function getWebhookData(): array
|
||||
{
|
||||
$settings = (array) $this->integrationData ?? [];
|
||||
|
||||
$formatter = (new FormSubmissionFormatter($this->form, $this->submissionData))->outputStringsOnly();
|
||||
if (Arr::get($settings, 'include_hidden_fields_submission_data', false)) {
|
||||
$formatter->showHiddenFields();
|
||||
}
|
||||
$formattedData = $formatter->getFieldsWithValue();
|
||||
|
||||
$settings = (array) $this->integrationData ?? [];
|
||||
$externalLinks = [];
|
||||
if (Arr::get($settings, 'link_open_form', true)) {
|
||||
$externalLinks[] = '*<' . $this->form->share_url . '|🔗 Open Form>*';
|
||||
|
||||
Reference in New Issue
Block a user