I have the following to post static text. Call Slack API via VBScript Rule in Outlook
How would I put the body of the email as the "text"?
I tried adding the following:
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