我的邮件附件上有一个贪睡选择按钮。
actions: [
{
name: 'snoozeTime',
text: 'Select a time...',
type: 'select',
options: [
{
text: '1 Hour',
value: '1hour'
},
{
text: '4 Hours',
value: '4'
},
{
text: '24 Hours',
value: '24hours'
},
{
text: 'Custom',
value: 'custom'
}
]
}
]
我想将用户重定向到我的网页以选择自定义贪睡时间。请告诉我怎么能实现它?
谢谢
Slack不支持自动重定向到第三方网站。几个星期前我和Slack一起讨论了这个功能,他们说他们在内部讨论过这个问题,但由于安全问题,他们此时不支持。
您当前唯一的选择(以及我为我的应用程序选择的那个选项,例如Rafflebot)是显示用户的自定义链接(作为松弛消息或附件的一部分),用户必须单击该链接然后打开您的网站。这有点难看,但它确实有效。
或者您可以等待Slack承诺实施的即将到来的“输入框”功能。您可以在Slack Platform Roadmap的“交互式消息阶段3”下找到它。我不知道任何时间表,但标记为“近期”。
顺便说一句,松弛平台现在支持这一点。 Slack Link Buttons
{
"text": "<@W1A2BC3DD> approved your travel request. Book any airline you like by continuing below.",
"channel": "C061EG9SL",
"attachments": [
{
"fallback": "Book your flights at https://flights.example.com/book/r123456",
"actions": [
{
"type": "button",
"name": "travel_request_123456",
"text": "Book flights 🛫",
"url": "https://flights.example.com/book/r123456",
"style": "primary"
},
{
"type": "button",
"name": "travel_cancel_123456",
"text": "Cancel travel request",
"url": "https://requests.example.com/cancel/r123456",
"style": "danger"
}
]
}
]
}