slack通知本地服务器_如何从您的WordPress网站获取Slack通知

slack通知本地服务器

Do you want to get Slack notifications based on certain activity on your WordPress site?

您是否要根据WordPress网站上的某些活动获得Slack通知?

Slack has become a central communication platform for many online businesses. Having activity notifications like new sales, new leads, new blog posts, etc. inside Slack can be helpful in streamlining your business workflows.

Slack已成为许多在线企业的中央交流平台。 在Slack内拥有活动通知(例如新销售,新潜在客户,新博客文章等)有助于简化业务工作流程。

In this article, we’re going to show you how to easily get Slack notifications from your WordPress site.

在本文中,我们将向您展示如何轻松地从WordPress网站获取Slack通知。

Getting Slack notifications from your WordPress site
为什么从您的WordPress网站获取Slack通知? (Why Get Slack Notifications From Your WordPress Site?)

Getting Slack notifications for key events on your WordPress site lets you keep everyone informed and even respond to certain things quickly.

通过在WordPress网站上获取关键事件的Slack通知,可以使每个人都了解情况,甚至可以快速响应某些事情。

For instance, you might want to get a Slack notification when your site’s contact form is completed. Or you may want a notification if a product in your online store is low on stock.

例如,您可能希望在网站的联系表填写完毕后收到Slack通知。 或者,如果在线商店中的产品库存不足,则可能需要通知。

We’re going to take you through several different ways to set up Slack notifications from your WordPress site.

我们将带您通过几种不同的方式从您的WordPress网站设置Slack通知。

You can simply use the navigation links to jump straight to the section you want.

您只需使用导航链接即可直接跳至所需部分。

发布新帖子时获得松弛通知 (Get a Slack Notification When a New Post is Published)

If you run many WordPress blogs like we do, then you may want to keep your team informed on all the new article updates that are going live.

如果像我们一样运行许多WordPress博客 ,那么您可能想让您的团队随时了解所有新的文章更新。

Alternatively, you may want to keep your team briefed on all the new things happening in your industry (competitor updates, thought leaders, etc).

另外,您可能想让您的团队了解行业中发生的所有新情况(竞争对手更新,思想领袖等)。

This is where Slack notifications can help. You can simply create a new channel that gets RSS feed updates from your favorite sites.

这是Slack通知可以提供帮助的地方。 您只需创建一个新频道即可从您喜欢的网站获取RSS feed更新。

First, go to the RSS app page in Slack’s App Directory then click the ‘Add to Slack’ button.

首先,转到Slack应用目录中的RSS应用页面,然后单击“添加到Slack”按钮。

Adding the RSS app to your Slack workspace

Next, click the ‘Add RSS integration’ button.

接下来,点击“添加RSS集成”按钮。

Click the button to continue setting up the RSS integration

Now, you need to enter the URL of the feed you want to add and choose which Slack channel you want to post notifications to. Once you’ve entered these details, click the ‘Subscribe to this feed’ button.

现在,您需要输入要添加的供稿的URL,并选择要将通知发布到的Slack频道。 输入这些详细信息后,点击“订阅此供稿”按钮。

Adding your RSS feed's URL to the Slack RSS app

The app will then fetch and display your RSS feed title on screen.

The RSS feed has now been added to your list of feeds

然后,该应用将获取并在屏幕上显示您的RSS Feed标题。

If you run multiple WordPress sites, then you can add more feeds as needed.

如果您运行多个WordPress网站,则可以根据需要添加更多供稿。

Tip: You don’t have to own the RSS feed. You could use the RSS app to keep an eye on your competitors’ sites or stay on top of news from other blogs in your industry.

提示:您不必拥有RSS feed。 您可以使用RSS应用程序来关注竞争对手的网站,或者关注行业内其他博客的新闻。

You will now automatically get a notification in your chosen Slack channel when a new post is published. The app checks for new items every few minutes, which means these notifications may not appear instantly.

现在,当发布新帖子时,您将在所选的Slack频道中自动收到通知。 该应用程序每隔几分钟检查一次新项目,这意味着这些通知可能不会立即显示。

A new blog post notification shown in Slack
设置Slack Notifications WordPress插件 (Setting Up the Slack Notifications WordPress Plugin)

If you want Slack to notify you about new posts, comments, WooCommerce orders, and other activity on your site, then you need to use the Slack Notifications plugin.

如果您希望Slack通知您有关站点上的新帖子,评论,WooCommerce订单和其他活动的信息,则需要使用Slack Notifications插件。

First, you need to do install and activate the Slack Notifications plugin. For more details, see our step by step guide on how to install a WordPress plugin.

首先,您需要安装并激活Slack Notifications插件。 有关更多详细信息,请参阅有关如何安装WordPress插件的分步指南。

Upon activation, click the Slack Notifications link at the bottom of your WordPress admin sidebar. You will see the Slack Integration page.

激活后,单击WordPress管理员侧边栏底部的Slack Notifications链接。 您将看到“松弛集成”页面。

Setting up the Slack Notification plugin's integration with Slackapps page on Slack and click the ‘Create an App’ button:

Creating a new app in Slack

Next, enter a name for your app and choose your workspace from the drop-down list. Then, go ahead and click the ‘Create App’ button:

接下来,为您的应用程序输入一个名称,然后从下拉列表中选择您的工作区。 然后,继续并点击“创建应用”按钮:

Name your app and select a workspace

You’ll now see a page titled Basic Information. Here, you need to click on the ‘Incoming Webhooks’ section.

现在,您将看到标题为“基本信息”的页面。 在这里,您需要单击“传入的Webhooks”部分。

Click on the 'Incoming Webhooks' feature

On the next screen, switch the ‘Activate Incoming Webhooks’ slider to the ‘On’ position:

在下一个屏幕上,将“激活传入的Webhooks”滑块切换到“打开”位置:

Switch the toggle on to activate incoming webhooks

After that, you need to scroll down the page and click on the ‘Add New Webhook to Workspace’ button:

之后,您需要向下滚动页面,然后单击“将新的Webhook添加到工作区”按钮:

Click the button to add a new webhook to your workspace

Slack will now prompt you to select the channel from a drop-down list. You need to click the ‘Allow’ button to give the app permission to post to it:

现在,Slack将提示您从下拉列表中选择频道。 您需要单击“允许”按钮以授予应用发布权限:

Select a channel and give your webhook permission to post to it

You will now see the previous page again, with your webhook in place. Simply copy this or leave the tab open, as we will need it in a moment.

现在您将再次看到上一页,并且已建立Webhook。 只需将其复制或打开选项卡即可,因为稍后我们会需要它。

Getting the URL for your webhook

Now you need to switch back to your WordPress site’s Slack Notifications settings page. On this page, go ahead and copy / paste the webhook URL you created earlier, enter the default channel, and the bot name that you want to use.

现在,您需要切换回WordPress网站的Slack Notifications设置页面。 在此页面上,继续并复制/粘贴您先前创建的Webhook URL,输入默认频道和您要使用的机器人名称。

Setting up the Slack Notification plugin's integration with Slack

After that, you need to scroll down the page and click on the ‘Run Test’ button at the bottom.

之后,您需要向下滚动页面并单击底部的“运行测试”按钮。

Run a test of the Slack Notifications plugin to make sure the integration is working

You should get a notification into your Slack channel like this. The app will have the name you gave it when setting it up in Slack.

您应该像这样在您的Slack频道中收到一条通知。 在Slack中设置应用时,该应用将具有您为其提供的名称。

The test message, successfully received in Slack

Don’t forget to click the ‘Save Settings’ button at the bottom of the page, too.

别忘了单击页面底部的“保存设置”按钮。

The Slack Notifications plugin is correctly connected. The next step is to set up notifications from your WordPress site.

Slack Notifications插件已正确连接。 下一步是从您的WordPress网站设置通知。

To set up any notification, you need to go to Slack Notifications » Notifications in your WordPress admin. Click the ‘Add New’ button at the top of the screen:

要设置任何通知,您需要转到WordPress管理员中的Slack Notifications»Notifications 。 点击屏幕顶部的“添加新”按钮:

Adding a new notification using the Slack Notifications WordPress plugin

We will go through several different useful options that you may want to use.

我们将介绍您可能想使用的几个不同的有用选项。

在Slack中获取WooCommerce销售通知 (Get a WooCommerce Sales Notification in Slack)

Are you running an online store with WooCommerce? Typically you can setup new sale notifications via email, but did you know that you can setup WooCommerce sales notification in Slack too?

您是否正在通过WooCommerce经营在线商店 ? 通常,您可以通过电子邮件设置新的销售通知,但是您知道您也可以在Slack中设置WooCommerce销售通知吗?

With the Slack Notifications plugin, you can get a message to your chosen channel whenever a new WooCommerce order comes in.

使用Slack Notifications插件,每当有一个新的WooCommerce订单进入时,您都可以将消息发送到您选择的频道。

First, make sure you’ve followed the instructions above to set up Slack Notifications correctly.

首先,请确保您已按照上述说明正确设置了Slack Notifications。

Then, simply set up WooCommerce notifications by going to Slack Notifications » Notifications and clicking on the ‘Add New’.

然后,只需转到Slack Notifications»Notifications并单击“ Add New”即可设置WooCommerce通知。

You’ll see several drop-downs. Go ahead and set ‘Notification Type’ to ‘WooCommerce’ and leave ‘Notification Options’ set to ‘New Order’. After that, click the ‘Save Notifications’ button.

您会看到几个下拉菜单。 继续,将“通知类型”设置为“ WooCommerce”,并将“通知选项”设置为“新订单”。 之后,点击“保存通知”按钮。

Setting up a new WooCommerce order notification for Slack

You should now get a notification in Slack whenever a new order comes in. This will include the order ID, status, total, and payment method. It will also include the item(s) purchased.

现在,每当有新订单进来时,您都应该在Slack中收到通知。这将包括订单ID,状态,总数和付款方式。 它还将包括所购买的物品。

Note: The notification will not include any personal details such as the customer’s name or address.

注意:通知中将不包含任何个人详细信息,例如客户的姓名或地址。

The Slack notification for a new order in WooCommerce
收到插件更新的松弛通知 (Get a Slack Notification for Plugin Updates )

Outdated plugins can be a serious risk to the security of your WordPress site. As a business owner, sometimes you might get busy and forget to update plugins, especially if you run multiple websites.

过时的插件可能会严重威胁WordPress网站安全 。 作为企业主,有时您可能会很忙,忘记更新插件,尤其是在您运行多个网站的情况下。

The Slack Notifications plugin lets you get a notification whenever a plugin needs updating.

使用Slack Notifications插件,您可以在需要更新插件时获得通知。

First, you need to install, activate, and set up the plugin, as shown above. Then, go to Slack Notifications » Notifications in your WordPress admin and click the ‘Add New’ button.

首先,您需要安装,激活和设置插件,如上所示。 然后,转到WordPress管理员中的Slack Notifications»通知 ,然后单击“添加新”按钮。

For the ‘Notification Type’ select ‘System’ and for the ‘Notification Options’ select ‘Plugin Update Available’. After that click, Save Notifications button.

对于“通知类型”,选择“系统”,对于“通知选项”,选择“可用插件更新”。 之后,单击“保存通知”按钮。

Setting up a Slack notification for when a plugin update is available

You’ll receive a notification in Slack whenever a plugin needs updating:

每当插件需要更新时,您都会在Slack中收到通知:

A plugin update notification in Slack

Note: You can also set up an alert for theme updates and core WordPress updates in the same way.

注意:您也可以以相同的方式为主题更新和WordPress核心更新设置警报。

在Slack中获取新的评论通知 (Get New Comment Notifications in Slack)

The Slack Notification plugin also lets you easily get notified of new comments on your WordPress site.

Slack Notification插件还使您可以轻松地在WordPress网站上收到有关新评论的通知。

Simply install, activate, and set up the plugin, as shown above. Then, go to Slack Notifications » Notifications in your WordPress admin and click the ‘Add New’ button.

只需安装,激活和设置插件,如上所示。 然后,转到WordPress管理员中的Slack Notifications»通知 ,然后单击“添加新”按钮。

Next, you need to set the Notification Type to ‘Comments’. The Notification Options drop-down should default to ‘New Comment’. After that, simply click the ‘Save Notifications’ button at the bottom.

接下来,您需要将通知类型设置为“评论”。 通知选项下拉列表应默认为“新评论”。 之后,只需单击底部的“保存通知”按钮。

Setting up new comment notifications into Slack from WordPress

You’ll now receive a notification in Slack for each new comment on your site. This will include a link to the post being commented on, the commenter’s name and email address, and the text of their comment:

现在,您会在Slack中收到有关您网站上每个新评论的通知。 这将包括指向被评论的帖子的链接,评论者的姓名和电子邮件地址以及他们评论的文本:

The new comment notification in Slack

There are lots of other ways you could use the Slack Notification plugin to stay aware of what’s happening on your WordPress site.

您可以使用许多其他方式使用Slack Notification插件来了解WordPress网站上正在发生的事情。

For instance, you could get a notification every time a page is updated, every time a new post is scheduled, and so much more.

例如,每次页面更新,每次安排新帖子等时,您都可能会收到通知。

提交WordPress联系表单/潜在客户表单时获得松弛通知 (Get a Slack Notification When a WordPress Contact Form / Lead Form is Submitted)

Often business owners want to immediately respond to new sales / lead form inquiries. You can connect just about every WordPress contact form to Slack using a tool called Zapier.

通常,企业主希望立即响应新的销售/销售线索查询。 您可以使用名为Zapier的工具将几乎每个WordPress联系人表单连接到Slack。

Zapier is like a bridge that lets you connect two apps, such as WPForms and Slack. It works with over 2,000 different apps. For the sake of this example, we’ll use WPForms which is the #1 rated WordPress form plugin.

Zapier就像一座桥梁,可让您连接两个应用程序,例如WPForms和Slack。 它可以与2,000多种不同的应用程序一起使用。 为了这个示例,我们将使用WPForms,它是WordPress表单插件排名第一的工具。

First, you’ll need to install and activate the WPForms plugin. For more details, see our step by step guide on how to install a WordPress plugin.

首先,您需要安装并激活WPForms插件。 有关更多详细信息,请参阅有关如何安装WordPress插件的分步指南。

Note: you’ll need at least the Pro version of WPForms to use the Zapier addon.

注意:您至少需要WPForms Pro版本才能使用Zapier插件。

Upon activation, go to the WPForms » Settings page to enter your license key. You will find the license key in your account section on the WPForms website.

激活后,转到WPForms»设置页面以输入您的许可证密钥。 您可以在WPForms网站的“帐户”部分中找到许可证密钥。

Entering your license key for WPForms

Next, go to the WPForms » Addon page. Find the Zapier addon, then go ahead and install and activate it.

接下来,转到WPForms»Addon页面。 找到Zapier插件,然后继续安装并激活它。

Installing the Zapier addon for WPForms

Once you’ve installed that addon, go to the WPForms » Settings » Integrations page. Simply click on the Zapier logo here, and you’ll see your Zapier API key.

安装该插件后,转到WPForms»设置»集成页面。 只需单击此处的Zapier徽标,您就会看到Zapier API密钥。

Get your API key from WPForms to use with Zapier

You need this to connect Zapier and WPForms, so copy it somewhere safe or keep this tab open in your browser.

您需要使用它来连接Zapier和WPForms,因此请将其复制到安全的位置或在浏览器中保持此选项卡处于打开状态。

You then need to set up a form and submit a test entry. We’re going to use the ‘Suggestion Form’ template as the basis of our form.

然后,您需要设置一个表单并提交测试条目。 我们将使用“建议表单”模板作为表单的基础。

You can follow our instructions on creating a form in WPForms for help getting your form set up.

您可以按照有关在WPForms中创建表单的说明进行操作,以帮助您设置表单。

You will also need an account with both Zapier and Slack. In your Slack workspace, you need to add the Zapier app.

您还将需要同时拥有Zapier和Slack的帐户。 在您的Slack工作区中,您需要添加Zapier应用程序

Then, you can create your Zap. Login to Zapier and click the ‘Make a Zap’ button on the top-left to start the configuration wizard.

然后,您可以创建您的Zap。 登录到Zapier ,然后单击左上角的“制作Zap”按钮以启动配置向导。

Click on the button to start making your Zap

In Zapier, a ‘zap’ is a process with a trigger and an action. Our trigger will be someone completing the form, and our action will be to send a Slack message.

在Zapier中,“ zap”是具有触发器和动作的过程。 我们的触发器将是填写表单的人,而我们的动作将是发送Slack消息。

At the top of the screen, go ahead and give your zap a name. After that, we need to set up the trigger.

在屏幕顶部,继续为zap命名。 之后,我们需要设置触发器。

In the ‘Choose App & Event’ box, simply type ‘WPForms’ into the search bar and click on the WPForms icon that appears.

在“选择应用程序和事件”框中,只需在搜索栏中键入“ WPForms”,然后单击出现的WPForms图标。

Choose the WPForms app to start off your Zap

Zapier should automatically fill in the trigger event ‘New Form Entry’, so you just need to click the ‘Continue’ button.

Zapier应该自动填写触发事件“ New Form Entry”,因此您只需要单击“ Continue”按钮。

Triggering the zap when the form is submitted

You’ll then be asked to log in to your WPForms account. Simply click on the ‘Sign in to WPForms’ button:

然后将要求您登录到WPForms帐户。 只需单击“登录WPForms”按钮:

Click the button to sign into WPForms

Next, you’ll see a popup window. Here, you need to copy the API key from WPForms that you found earlier. You also need to enter the URL (domain name) of your website. Once you’ve entered these, click the ‘Yes, Continue’ button.

接下来,您将看到一个弹出窗口。 在这里,您需要从之前找到的WPForms复制API密钥。 您还需要输入网站的URL( 域名 )。 输入这些内容后,点击“是,继续”按钮。

Enter your API key from WPForms and the URL of your website

On the next step, Zapier will ask you to choose your form from a drop-down list. Just click on the form that you want to use, then click the ‘Continue’ button.

下一步,Zapier会要求您从下拉列表中选择表单。 只需单击您要使用的表单,然后单击“继续”按钮。

Select the form that you want to receive Zap notifications from

You will now be prompted to test your trigger. Click the ‘Test trigger’ button so that Zapier can look for your test entry.

现在将提示您测试触发器。 单击“测试触发器”按钮,以便Zapier可以查找您的测试条目。

Test your trigger to make sure Zapier has found your test WPForms entry

Once Zapier has found your test data, go ahead and click the ‘Continue’ button.

Zapier找到测试数据后,请继续并单击“继续”按钮。

For the ‘Do this’ action part of the Zap, you need to choose Slack as your app. Simply type ‘Slack’ into the search bar and then click on the Slack app:

对于Zap的“执行此操作”操作,您需要选择Slack作为您的应用。 只需在搜索栏中输入“ Slack”,然后单击Slack应用即可:

Select Slack as the app for the "Do This" part of the zap

Next, you need to choose your Action Event. We’re going to choose ‘Send Channel Message’ here.

接下来,您需要选择您的动作事件。 我们将在此处选择“发送频道消息”。

Select "Send Channel Message" from the drop-down list to get the notification to a channel in Slack

Tip: There are several other actions you could choose instead. For instance, you could trigger a direct message or a reminder.

提示:您可以选择其他几种操作。 例如,您可以触发直接消息或提醒。

Now, click the ‘Continue’ button. You will then be prompted to sign in to Slack. Simply follow the on-screen prompts to sign in and give Zapier permission to access your Slack workspace.

现在,单击“继续”按钮。 然后将提示您登录Slack。 只需按照屏幕上的提示登录即可,并授予Zapier权限以访问您的Slack工作区。

Once you’ve connected your Slack account, click the Continue button again to move on.

连接Slack帐户后,再次单击“继续”按钮继续。

You’ll then be prompted to pick a channel from the drop-down list. We’ve chosen ‘website’ for ours.

然后,系统会提示您从下拉列表中选择一个频道。 我们为我们选择了“网站”。

Choose the Slack channel that you want to receive form notifications to

Next, you’ll need to enter the text for the notification.

接下来,您需要输入通知文字。

You can include the details of the form submission, as we’ve done here. When you click on the box, you’ll see your form fields in a drop-down below. Go ahead and add whichever fields you want to the message.

您可以按照此处的步骤添加表单提交的详细信息。 单击该框时,您会在下面的下拉列表中看到表单字段。 继续,然后将想要的任何字段添加到消息中。

Tip: The name of the fields will not be included in the Slack notification. We have added some text before each field to help make the message clear.

提示:字段名称不会包含在Slack通知中。 我们在每个字段之前添加了一些文本,以帮助使消息清晰。

Setting up the message for your Slack notification

Now, you need to give your bot a name. You may also want to choose an emoji. You can leave the other options as their defaults.

现在,您需要给您的机器人起个名字。 您可能还需要选择一个表情符号。 您可以将其他选项保留为默认值。

The different options you can choose from in Zapier for your Slack notification

Once you are ready, click the ‘Continue’ button to move on.

准备就绪后,单击“继续”按钮继续。

It’s time to try out your app. Go ahead and click the ‘Test & Review’ button.

现在该尝试您的应用了。 继续,然后点击“测试与审查”按钮。

Reviewing the details of your zap and testing it out

Zapier will send your test data to Slack. Go ahead and check Slack to see if your message came through as expected. If there is anything you want to change, you can go back and do so.

Zapier会将您的测试数据发送到Slack。 继续并检查Slack,以查看您的消息是否按预期通过。 如果您要更改任何内容,可以返回并进行更改。

Once you’re happy with the Zap, simply click the ‘Turn on Zap’ button.

对Zap满意后,只需单击“打开Zap”按钮。

Turn on your Zap once you've tested it to make sure it's working

You may also want to send a new test entry through your form to ensure it appears correctly in Slack. Here is our Slack channel with our first test message plus a second one submitted after the Zap was turned on:

您可能还希望通过表单发送新的测试条目,以确保其正确显示在Slack中。 这是我们的Slack频道,其中包含我们的第一条测试消息以及Zap开启后提交的第二条消息:

Examples of Slack notifications that have come through the WPForms suggestion form on the WordPress site

You can use Zapier to connect just about every email marketing service, marketing automation tool, and other business tools with each other as well as Slack.

您可以使用Zapier几乎将每个电子邮件营销服务营销自动化工具和其他业务工具以及Slack彼此连接。

The process is roughly similar to what we have demonstrated above with WPForms.

该过程与上面用WPForms演示的过程大致相似。

When used properly, Slack Notifications can significantly streamline your workflow by centralizing all the important things inside the central communication platform for your business.

如果使用得当,Slack Notifications可以通过将所有重要事项集中在企业的中央通信平台中,从而极大地简化您的工作流程。

We hope this article helped you learn how to get Slack notifications from your WordPress site. You might also be interested in our articles on the best business phone services for small business, and the best live chat software to get more sales / improve support.

我们希望本文能帮助您学习如何从WordPress网站获取Slack通知。 您可能也对我们的文章感兴趣,这些文章中有关于小型企业的最佳商务电话服务以及获得更多销售/改善支持的最佳实时聊天软件的文章

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

如果您喜欢这篇文章,请订阅我们的YouTube频道 WordPress视频教程。 您也可以在TwitterFacebook上找到我们。

翻译自: https://www.wpbeginner.com/wp-tutorials/how-to-get-slack-notifications-from-your-wordpress-site/

slack通知本地服务器

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值