Celebrate WordCamp Asia 2024 with 30% OFF! Use coupon WC30 - Terms

SlackPRO

This knowledge base article relates to the WS Form Slack add-on. Included with the Freelance & Agency editions or buy separately for the personal edition.

Upgraded to 1.1.x? Slack recently introduced version 2 of their authentication method. Therefore you should disconnect and reconnect the WS Form Slack add-on to take advantage of the latest features of this add-on, including the ability to post messages to private channels.

The Add To Slack action allows you to push messages from a WordPress form  to Slack. You can fully configure the message sent to Slack with setting such as:

  • Color of the message
  • Message text
  • Attachment title, image, icon, buttons and fields

… and more!

You can incorporate WS Form variables into any of the message settings.

Messages can be posted to public and private channels in your workspace.

Private Channels: In order to post messages to private channels you must first add WS Form as an app to that channel. This is done after you have connected to Slack. To add WS Form to a private channel, click on the Conversation settings icon (gear) at the top of the channel, then click Add App, then add WS Form.

Installation

The official WS Form Slack add on page can be found here.

The Slack plugin is installed in the same way as installing the WS Form PRO plugin.

Once installed you will need to activate the license for the plugin. When you purchase the Slack plugin, you will be given a license key. If you have lost your license key(s), click here.

To activate your license key:

  1. Click WS Form in the WordPress administration menu.
  2. Click Settings.
  3. Click the Slack tab at the top of the page.
  4. Enter your license key.
  5. Click the Activate button.

If your license key fails to activate, please ensure you are using the correct license key and not your WS Form PRO license key.

Connecting to Slack

In order to use the add-on, you need to connect it to Slack. Connecting is easy!

  1. Click WS Form in the WordPress administration menu.
  2. Click Settings.
  3. Click the Slack tab at the top of the page.
  4. Click Connect and follow the onscreen prompts

If you do not have a Slack account, you can create a new account here.

Creating a Slack Form

Automatically (Recommended)

WS Form PRO can create a form that is is pre-configured to push messages to any of your Slack channels. The form comes with a single text field but you can add other fields that can also be pushed to Slack. This process not only creates a form but also fully configures WS Form PRO so that the form is ready to use immediately.

To create a Slack form in WS Form:

  1. Click WS Form in the WordPress administration menu.
  2. Click Add New.
  3. Select the Slack tab at the top of the page.
  4. Click on any of your Slack channels to create a form.
  5. Wait a few moments while the form is created.

That’s it! Your form will be created and is ready to add to your website.

If you chose a private Slack channel you must first add WS Form as an app to that channel. To add WS Form to a private channel, click on the Conversation settings icon (gear) at the top of the channel, then click Add App, then add WS Form.

Manually

It is also possible to use any form created in WS Form and add an action so that it is submitted to Slack when a user saves or submits their form.

To add a Slack action:

  1. When editing your form, click the Actions icon at the top of the page. The Actions sidebar will open on the right-hand side of the page.
  2. Click the Add  icon to add a new action.
  3. Select Add to Slack from the Action pulldown. A series of settings will appear.

As with all sidebars in WS Form, click to the Save button at the bottom to save your changes, or click Cancel to disregard your changes.

The Slack action settings are as follows:

When Should This Action Run?

You can choose to run the user management action when the form is saved, submitted, or both.

Slack Channel

Choose the Slack channel you would like to push the form submission data to. In order to post messages to private channels you must first add WS Form as an app to that channel. To add WS Form to a private channel, click on the Conversation settings icon (gear) at the top of the channel, then click Add App, then add WS Form.

Text

This is the main text you would like to be sent to Slack. You can either enter static text into this field, or include WS Form variables.

The text field can also be formatted using Slack mark up. Further information about formatting message text in Slack can be found here.

Attachment

Check this box if you want to add an attachment to the message. Attachments have a lot of additional settings which are found below.

Attachment Title

Enter the title of the attachment.

Attachment Title Link

If you would like the title of the attachment to link somewhere, enter the URL here.

Attachment Fallback

This should be a  plain-text summary of the attachment. This text will be used in clients that don’t show formatted text (eg. IRC, mobile notifications) and should not contain any markup.

Attachment Pretext

This is optional text that appears above the message attachment block.

Author Name

It is possible to accompany the message attachment with details about the author. Enter the author name into this field.

Author Link

Enter a valid URL that will hyperlink the Author Name text above. This will only work if Author Name is present.

Author Icon

Enter a valid URL that displays a small 16px x 16px image to the left of the Author Name text. This will only work if Author Name is present.

Attachment Text

This is where you should enter the main text for the attachment.

The text field can also be formatted using Slack mark up. Further information about formatting message text in Slack can be found here.

Attachment Color

Enter a hexadecimal color reference into this field. You can also enter:

  • good
  • warning
  • danger

Additionally you can also use WS Form variables in this field. For example: #skin_color_information

 

Buttons

You can add up to buttons to a message that link to any given URL.

To add a button.

  1. Click the Add  icon at the bottom right of the buttons section.
  2. Enter the text shown on button in the first column.
  3. Enter the URL the button will ink to in the second column. For example: #submit_admin_url would provide a convenient link to the submission in the WordPress administration.
  4. Choose the Style of the button in the third column.
  5. Repeat this process for each button you wish to add.
  6. Click the Save button at the bottom of the sidebar to save your changes.
Field Mapping

Field mapping tells WS Form which of your form fields you would like to add to the message attachment.

To map a field:

  1. Click the Add  icon at the bottom right of the field mapping section.
  2. Select your form field.
  3. Repeat this process for each field on your form.
  4. Click the Save button at the bottom of the sidebar to save your changes.
Image

You can select any file or signature field you have added to your form to be uploaded as the image for this attachment. Note that if you are using a signature field it should be set to output a JPG or PNG signature. Do not use SVG as this is not supported by Slack.

Supported file formats are: JPG, GIF, PNG and BMP.

Icon

You can select any file or signature field you have added to your form to be uploaded as the icon for this attachment. Note that if you are using a signature field it should be set to output a JPG or PNG signature. Do not use SVG as this is not supported by Slack.

Supported file formats are: JPG, GIF, PNG and BMP.

Footer Text

Enter the text you would like to be entered as the footer of that attachment.

This defaults to the name of the WS Form PRO Slack add-on so that you can easily identify messages added via this method.

Footer Icon URL

Enter the URL of the icon you would like to be add to the left of the footer text.

This defaults to the WS Form icon so that you can easily identify messages added via this method.

Note: The WS Form PRO Slack Add-On is not created by, affiliated with, or supported by Slack Technologies, Inc.