Add-On for Discord and Gravity Forms

描述

Automatically send Gravity Form entries to a Discord channel using an Incoming Webhook.

螢幕截圖

  • Plugin settings page
  • Form feed settings page
  • Entry page
  • Discord channel post

安裝

  1. Install the plugin from your website’s plugin directory, or upload the plugin to your plugins folder.
  2. Activate it.
  3. Go to Gravity Forms > Settings > Discord.

常見問題

Where can I request features and get further support?

Join my Discord support server

How can I mention a user or tag a channel in my messages?

From the form’s Discord feed, you can mention a user with {{@user_id}} or a role with {{@&role_id}}, and tag a channel with {{#channel_id}}. If you’re unfamiliar with where to find these IDs, check out this article on Discord.

How can I further customize the message sent to Discord?

With version 1.0.6, you can now use the following hook:

<?php
add_filter( 'gf_discord_embeds', 'my_gf_discord_embeds', 10, 3 );
function my_gf_discord_embeds( $embeds, $form, $entry ) {
    // Filter the message
    $embeds[0][ 'description' ] = str_replace( '{{my_own_merge_tag}}', 'New Value', $embeds[0][ 'description' ] );

    // Add a new field
    $user_id = $entry[ 'created_by' ];
    $user = get_user_by( 'ID', $user_id );
    $display_name = $user->display_name;

    $embeds[0][ 'fields' ][] = [
        'name'  => 'Completed By:',
        'value' => $display_name
    ];

    // Always return embeds
    return $embeds;
} // End my_gf_discord_embeds()
?>

評價

閱讀全部1個評價

貢獻者及開發者

“Add-On for Discord and Gravity Forms” 是一個開源的軟體。以下的人對這個外掛作出了貢獻。

貢獻者

修改日誌

1.0.8

  • Fix: Fatal error undefined function (props calamarigold)

1.0.7

  • Fix: Multiselect fields not showing all values (props calamarigold)
  • Tweak: Removed required email field (props calamarigold)

1.0.6

  • Update: Added filter for embeds to further customize message
  • Tweak: Added support for mentioning a role via the feed message box using {{@&role_id}}

1.0.5

  • Fix: & symbol displayed as &
  • Fix: Deprecation notice passing # in hexdec()
  • Update: Added support for tagging a channel via the feed message box using {{#channel_id}}
  • Update: Added support for mentioning a user via the feed message box using {{@user_id}} (props yaboinish)
  • Fix: URL back to form entry not working properly

1.0.4

  • Tweak: Removed some comments

1.0.3

  • Tweak: Updated Discord link

1.0.2

  • Update: Added option for removing footer altogether on feeds
  • Update: Added field to form settings for customizing the footer (props enes#4893)
  • Fix: Removed “Test 3” from footer

1.0.1

  • Created plugin on March 16, 2023