send(){
var index = 0
var a=setInterval(function () {
const element = array2[index]
need = element.need
pname = element.name
phNum = element.phNum
index++
var i = ''
var p = need.length
for (let i = 0; i < p; i++) {
const e = need[i];
db.collection("getWer").where({county:e}).get({
success:res=>{
var result = [res.data[0].county+"天气:"+res.data[0].weather+",气温:"+res.data[0].temday+"度。"+"\r\n"]
z.push(result)
y = z.join("")
}
})
}
setTimeout(function () {
wx.cloud.callFunction({
name:'send',
data:{
touser:'mail address',
text:y
},
success:res=>{
console.log("已发送给"+pname)
}
})
}, 1500)
if(index>=array2.length)
{ clearInterval(a) }
},3000)
},
自动推送邮件,包含批处理文本
最新推荐文章于 2024-07-12 16:33:35 发布