Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@Ba4bes
Last active January 31, 2020 17:54
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Ba4bes/d53c5005e1887e25d66aa1b82a92fbd2 to your computer and use it in GitHub Desktop.
Save Ba4bes/d53c5005e1887e25d66aa1b82a92fbd2 to your computer and use it in GitHub Desktop.
$URL = "Paste the Logic App URL here"
$Body = [PSCustomObject]@{
To = "Ex@mp.le"
Subject = "Subject of the mail"
Body = "Body (you can use HTML here if you like)"
}
# Create a line that creates a JSON from this object
$JSONBody = $Body | ConvertTo-Json
# this line sends the email through the logic app
Invoke-RestMethod -Method POST -Uri $URL -Body $JSONBody -ContentType 'application/json'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment