如何发送列表中一组项目的电子邮件通知? [英] how to send email notification for a group of items in a list?

查看:59
本文介绍了如何发送列表中一组项目的电子邮件通知?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试提出一个简单的购物图表应用程序,用户可以从列表中选择商品并将其移动到另一个命名的图表.我需要能够在单击自动电子邮件后创建一个按钮,该按钮应显示该项目的详细信息 刚刚被添加到列表中.我希望能够在一封电子邮件中发送所有详细信息.我知道SharePoint设计器将为创建的每个项目发送通知.在添加时,我可以根据需要添加订单ID.请让我知道是否需要更多详细信息 或从上面看不清的东西.

I am trying to come up with a simple shopping chart application where users can select items from a list and move it to another named chart. i need to be able to create a button upon clicking an automated email should fire with the details of that item's  that is just been added to the list. i want to be able send all the details in one email. i know that SharePoint designer will send notification for each items created. while adding i can add an order id if needed. please let me know if you need more details or something is not clear from above.

或者有什么方法可以将商品添加到具有订单ID的列表中?在点击链接时会显示所有基于订单ID的订单的详细信息吗?

or is there any way we can add an item to a list with order id ? and while clicking on a link it will show the details of all the orders that has been made based on the order id?

推荐答案

这是示例脚本,用于向用户发送电子邮件,并在列表视图(allitems.aspx)中向用户详细选择列表项.

您可以将脚本编辑器Webpart插入列表视图,然后将脚本插入其中.

<input id="Button1" onclick="SendEmainWithItems()" type="button" value="button" />
    <script src="https://code.jquery.com/jquery-1.9.1.min.js" type="text/javascript"></script>
    <script type="text/javascript">

        function getItemByItemID(ctx, listId, itemids) {
            //use of


.executeQueryAsync委托中的延迟允许该方法的使用者编写类似同步"的代码 var deferred =
.Deferred in the executeQueryAsync delegate allows the consumer of this method to write 'syncronous like' code var deferred =


.Deferred(); var list = ctx.get_web().get_lists().getById(listId); var spitems = []; 对于(i = 0; i< itemids.length; i ++){ var item = list.getItemById(itemids [i]); ctx.load(item); spitems.push(item); } ctx.executeQueryAsync( Function.createDelegate(this, 函数(){deferred.resolve(spitems); }), Function.createDelegate(this, 功能(发件人,参数){deferred.reject(sender,args); })); 返回deferred.promise(); }; 函数sendMail(toList,subject,mailContent){ var restUrl = _spPageContextInfo.webAbsoluteUrl +"/_api/SP.Utilities.Utility.SendEmail", restHeaders = { "Accept":"application/json; odata = verbose", "X-RequestDigest":
.Deferred(); var list = ctx.get_web().get_lists().getById(listId); var spitems = []; for (i = 0; i < itemids.length; i++) { var item = list.getItemById(itemids[i]); ctx.load(item); spitems.push(item); } ctx.executeQueryAsync( Function.createDelegate(this, function () { deferred.resolve(spitems); }), Function.createDelegate(this, function (sender, args) { deferred.reject(sender, args); })); return deferred.promise(); }; function sendMail(toList, subject, mailContent) { var restUrl = _spPageContextInfo.webAbsoluteUrl + "/_api/SP.Utilities.Utility.SendEmail", restHeaders = { "Accept": "application/json;odata=verbose", "X-RequestDigest":


这篇关于如何发送列表中一组项目的电子邮件通知?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆