tag:blogger.com,1999:blog-9115553840017295752.post8434958256295492987..comments2024-03-26T11:55:07.764+01:00Comments on Microsoft BI Tools: SendGrid - Send emails via a RunbookJoost van Rossumhttp://www.blogger.com/profile/01125981589974671317noreply@blogger.comBlogger7125tag:blogger.com,1999:blog-9115553840017295752.post-63417784177392253522021-08-24T12:59:16.887+02:002021-08-24T12:59:16.887+02:00hi
I tried using the above code as it is . But i...hi <br /> I tried using the above code as it is . But i do not get any email .I use my personal send grid api key .With that key i am able to send email from a python code snippet .<br /><br />Any help on this will be much appreciated.<br /><br />Regards Anonymoushttps://www.blogger.com/profile/03331419401489160238noreply@blogger.comtag:blogger.com,1999:blog-9115553840017295752.post-2379530425093945712021-07-15T20:21:50.944+02:002021-07-15T20:21:50.944+02:00Did you use the code above?Did you use the code above?Joost van Rossumhttps://www.blogger.com/profile/01125981589974671317noreply@blogger.comtag:blogger.com,1999:blog-9115553840017295752.post-91340766065516471032021-07-15T12:27:47.026+02:002021-07-15T12:27:47.026+02:00Hi ,
I am getting below error in Azure Runbook
S...Hi ,<br /><br />I am getting below error in Azure Runbook<br /><br />System.Management.Automation.CommandNotFoundException: The term 'Send-SendGridEmail' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.<br /> at System.Management.Automation.CommandDiscovery.LookupCommandInfo(String commandName, CommandTypes commandTypes, SearchResolutionOptions searchResolutionOptions, CommandOrigin commandOrigin, ExecutionContext context)<br /> at System.Management.Automation.CommandDiscovery.LookupCommandProcessor(String commandName, CommandOrigin commandOrigin, Nullable`1 useLocalScope)<br /> at System.Management.Automation.ExecutionContext.CreateCommand(String command, Boolean dotSource)<br /> at System.Management.Automation.PipelineOps.AddCommand(PipelineProcessor pipe, CommandParameterInternal[] commandElements, CommandBaseAst commandBaseAst, CommandRedirection[] redirections, ExecutionContext context)<br /> at System.Management.Automation.PipelineOps.InvokePipeline(Object input, Boolean ignoreInput, CommandParameterInternal[][] pipeElements, CommandBaseAst[] pipeElementAsts, CommandRedirection[][] commandRedirections, FunctionContext funcContext)<br /> at System.Management.Automation.Interpreter.ActionCallInstruction`6.Run(InterpretedFrame frame)<br /> at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)Sudhirhttps://www.blogger.com/profile/00158610241637773729noreply@blogger.comtag:blogger.com,1999:blog-9115553840017295752.post-69330827902166338162021-05-28T02:28:03.358+02:002021-05-28T02:28:03.358+02:00Hi,
You can use a array and store your emails ad...Hi, <br /><br />You can use a array and store your emails addresses inside that. After that you can use a foreach loop and iterate over it.<br /><br />$toEmailAddresses = "abc@gmail.com", "def@gmail.com", "avf@gmail.com"<br />foreach($toEmailAddress in $toEmailAddresses)<br />{<br /><br /># Create a JSON message with the parameters from above<br />$body = @{<br />personalizations = @(<br /> @{<br /> to = @(<br /> @{<br /> email = $toEmailAddress<br /> }<br /> )<br /> }<br />)<br />from = @{<br /> email = $fromEmailAddress<br />}<br />subject = $subject<br />content = @(<br /> @{<br /> type = "text/plain"<br /> value = $content<br /> }<br />)<br />}<br /><br />$bodyJson = $body | ConvertTo-Json -Depth 4<br /><br />$response = Invoke-RestMethod -Uri https://api.sendgrid.com/v3/mail/send -Method Post -Headers $headers -Body $bodyJson<br /><br /> Gouthamnoreply@blogger.comtag:blogger.com,1999:blog-9115553840017295752.post-80148396237171209522021-03-26T17:14:05.607+01:002021-03-26T17:14:05.607+01:00Hi,
has anyone been able yet to change this into ...Hi, <br />has anyone been able yet to change this into an array so multiple recipients can receive emailsAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-9115553840017295752.post-40054461087359014482021-01-14T16:00:05.922+01:002021-01-14T16:00:05.922+01:00Yes it is possible by changing the JSON message (e...Yes it is possible by changing the JSON message (email string probably becomes an array of email strings). When I have some time left I will have a look at it an add some sample code. Meanwhile google is your friendJoost van Rossumhttps://www.blogger.com/profile/01125981589974671317noreply@blogger.comtag:blogger.com,1999:blog-9115553840017295752.post-20819424076828683592021-01-14T10:55:07.062+01:002021-01-14T10:55:07.062+01:00hi,
it is possible to send the email to multiple r...hi,<br />it is possible to send the email to multiple recipients?<br />SimoneAnonymoushttps://www.blogger.com/profile/08007607778429278259noreply@blogger.com