在 SharePoint 生成的电子邮件中批准/拒绝
当我在 Outlook 中召开会议时,收件人会在电子邮件顶部看到一个批准/拒绝按钮。 我想对 SharePoint 执行类似的操作:创建任务时,会向分配该任务的人员发送一封电子邮件,该电子邮件会要求收件人接受或拒绝该任务。 我见过人们使用自定义 ASPx 页面执行此操作的演示,但我想直接在电子邮件中进行此操作。 我应该怎样做呢?
我习惯于在 Visual Studio 中制作工作流程,因此我对用于设置电子邮件和/或解析响应的代码示例感到满意
Cheers
Nik
When I make a meeting in Outlook, the recipient gets a approve/reject button in the top of the email. I'd like to do a similar thing with SharePoint: when a task is created, an email is sent to the person the task is assigned to, and the email asks the recipient to either accept or reject the task. I've seen demos of people doing this with a custom ASPx page, but I'd like to make it directly in the email. How should I go about doing that?
I'm used to making workflows in Visual Studio, so I'm happy with code examples for setting up an email and/or parsing the response
Cheers
Nik
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Outlook 中显示批准/拒绝按钮是因为电子邮件采用 iCalendar 格式。 我不知道这是否是最好的方法,但您可以使用 C# 代码发送您自己的 iCalendar 电子邮件,并将响应电子邮件设置到您控制的邮件服务器。 您可以从该邮件服务器处理电子邮件并使用 SharePoint WebService API 批准 SharePoint 中的项目。
The approve/reject buttons in Outlook shows up because the email is in the iCalendar format. I dont know if this is the best way, but you can send out your own iCalendar emails using C# code and set the response email to a mail server you control. From that mail server you can process the email and use the SharePoint WebService API to approve the item in SharePoint.
我喜欢 JMD 的建议,但我不知道您如何从邮件服务器与 SharePoint 交互。
发送带有接受和拒绝按钮的两个链接 (
...
) 的 HTML 格式的电子邮件可能会更容易。 您可以使用 CSS 来格式化它们,使它们看起来像真正的按钮。然后,您可以创建一个 ASPX 页面(或者更好的
IHttpHandler
实现)来根据通过 URL 传递给它的参数执行操作。 您需要传递站点、网络和列表详细信息以及列表项 ID 以及一个值,以指示该项目是被批准还是被拒绝。然后在电子邮件中设置“按钮”的 URL 以调用处理程序并传入适当的参数值。
这样做的缺点是“按钮”将是邮件正文的一部分,而不是 Outlook chrome 的一部分,但另一方面,它们可以从任何电子邮件客户端使用。
I like JMD's suggestion but I don't know how you'd interact with SharePoint from the mail server.
It might be a easier to send an HTML-formatted email with two links (
<a href="...">...</a>
) for the Accept and Reject buttons. You could use CSS to format them so that they look like real buttons.You could then create an ASPX page (or better an
IHttpHandler
implementation) to perform an action based on parameters passed to it via a URL. You'd want to pass in the site, web and list details and the list item ID along with a value to indicate whether the item is approved or rejected.Then set the URLs of your "buttons" in the email to call your handler and pass in the appropriate parameter values.
The downside to this is that the "buttons" would be part of the message body and not part of the Outlook chrome but, on the other hand, they would be usable from any email client.