Slack API,VBScript和Outlook-如何发布电子邮件正文?

时间:2019-02-22 09:36:14

标签: vba outlook slack slack-api

我已经使用了以下内容,并且能够发布静态文本(谢谢!) Call Slack API via VBScript Rule in Outlook

我如何将电子邮件正文作为“文本”?我尝试添加以下内容:

Sub ProcessSend(Item As Outlook.MailItem)
Set oXMLHTTP = CreateObject("MSXML2.XMLHTTP.6.0")
Set oXMLDoc = CreateObject("MSXML2.DOMDocument")

dim bodymsg as string
bodymsg = mailitem.body

strEnvelope = "payload={""channel"": ""#general"", ""username"": ""Help!"", ""text"": bodymsg ""Hello @general, sorry I don't have a room number for you yet!"", ""icon_emoji"": "":PartyParrot:""}"

Call oXMLHTTP.Open("POST", "https://hooks.slack.com/services/customidnumberurlblabla" & posFirm, False)
Call oXMLHTTP.setRequestHeader("Content-Type", "application/x-www-form-urlencoded")
Call oXMLHTTP.Send(strEnvelope)

Dim szResponse: szResponse = oXMLHTTP.responseText
   Call oXMLDoc.LoadXML(szResponse)
           End Sub'''''''''''''''''

任何帮助将不胜感激。是的,我是新手。

谢谢, 马库斯

1 个答案:

答案 0 :(得分:1)

原来,我只需要执行以下操作:

id  keyword       keyword_2
1   transfer      transfer
2   atm transfer  atm
3   atm           atm
4   ulta transfer ulta

仍然感谢您的帮助。

干杯, 马库斯