You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在Power Automate邮件中实现可点击的7星评分反馈功能

实现Power Automate邮件中7星评分交互的方案

核心思路

用HTML构建可视化星级,每个星级绑定带评分参数的Power Automate触发链接,顾客点击后直接提交评分到指定数据源(如SharePoint列表、Dataverse)。


具体步骤

1. 创建接收评分的触发流

先搭建一个即时云流,触发方式选择「当HTTP请求收到时」:

  • 请求体JSON schema可设置为:
    {
      "type": "object",
      "properties": {
        "customerEmail": {
          "type": "string"
        },
        "rating": {
          "type": "integer"
        },
        "orderId": {
          "type": "string"
        }
      }
    }
    
  • 保存流后,复制生成的HTTP POST URL,后续邮件里的星级链接会用到这个地址。

2. 构建HTML星级评分模块

在发送邮件的「发送电子邮件(V2)」操作中,切换到HTML模式,插入以下自定义HTML代码(替换占位符):

<p>感谢您的光临,请为本次体验评分:</p>
<div style="font-size:24px; color:#ddd;">
  <a href="YOUR_HTTP_TRIGGER_URL?customerEmail=CUSTOMER_EMAIL&rating=1&orderId=ORDER_ID" style="text-decoration:none; color:#ddd;" onmouseover="this.style.color='#ffc107'" onmouseout="this.style.color='#ddd'">★</a>
  <a href="YOUR_HTTP_TRIGGER_URL?customerEmail=CUSTOMER_EMAIL&rating=2&orderId=ORDER_ID" style="text-decoration:none; color:#ddd;" onmouseover="this.style.color='#ffc107'" onmouseout="this.style.color='#ddd'">★</a>
  <a href="YOUR_HTTP_TRIGGER_URL?customerEmail=CUSTOMER_EMAIL&rating=3&orderId=ORDER_ID" style="text-decoration:none; color:#ddd;" onmouseover="this.style.color='#ffc107'" onmouseout="this.style.color='#ddd'">★</a>
  <a href="YOUR_HTTP_TRIGGER_URL?customerEmail=CUSTOMER_EMAIL&rating=4&orderId=ORDER_ID" style="text-decoration:none; color:#ddd;" onmouseover="this.style.color='#ffc107'" onmouseout="this.style.color='#ddd'">★</a>
  <a href="YOUR_HTTP_TRIGGER_URL?customerEmail=CUSTOMER_EMAIL&rating=5&orderId=ORDER_ID" style="text-decoration:none; color:#ddd;" onmouseover="this.style.color='#ffc107'" onmouseout="this.style.color='#ddd'">★</a>
  <a href="YOUR_HTTP_TRIGGER_URL?customerEmail=CUSTOMER_EMAIL&rating=6&orderId=ORDER_ID" style="text-decoration:none; color:#ddd;" onmouseover="this.style.color='#ffc107'" onmouseout="this.style.color='#ddd'">★</a>
  <a href="YOUR_HTTP_TRIGGER_URL?customerEmail=CUSTOMER_EMAIL&rating=7&orderId=ORDER_ID" style="text-decoration:none; color:#ddd;" onmouseover="this.style.color='#ffc107'" onmouseout="this.style.color='#ddd'">★</a>
</div>
<p>点击对应星级即可完成提交,无需额外填写表单</p>
  • 替换YOUR_HTTP_TRIGGER_URL为第一步生成的触发链接;
  • 替换CUSTOMER_EMAIL和ORDER_ID为流程中获取到的顾客邮箱、订单ID动态内容;
  • 样式可自定义:比如修改#ffc107更换高亮颜色,调整font-size改变星级大小。

3. 处理评分提交逻辑

回到接收评分的触发流,添加后续操作:

  • 用「解析JSON」操作解析请求参数(复用第一步的schema);
  • 添加「创建项」(SharePoint)或「创建记录」(Dataverse)操作,将customerEmail、rating、orderId存入数据源;
  • 可选:添加「发送电子邮件」操作,给顾客发送评分确认邮件。

4. 测试优化

  • 发送测试邮件,点击星级验证是否能触发流并正确存储数据;
  • 若邮件客户端屏蔽hover效果,可简化为静态彩色星级(默认灰色,点击提交),或补充提示文字;
  • 为防止重复提交,可在流中添加判断逻辑:检查该订单是否已存在评分,存在则跳过存储。

内容的提问来源于stack exchange,提问作者Kailash Sahoo

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.25 04:22:15