0

I was referring to the following guide on how to send a SharePoint no-reply email with a specific sender name, which was triggered via Power Automate:

https://michelcarlo.com/2020/04/04/sharepoint-http-connector-send-a-no-reply-email-specific-sender-name-in-a-flow/

I've tried both display name and email address (via the O365 connector) and assigned these values to the From property, but this did not work in either scenario. Unless something has changed in the connector since this guide was published, I'm stumped.

{
  'properties':{
  'From':'',
  'To':['@{variables('Email')}'],
  'CC':[''],
  'Subject':'@{variables('RequestID')} requires changes',
  'Body':'Dear @{variables('Name')},<br><br>Please update this item according the the following comment:<br><br>@{variables('Comments')}<br><br>Thank you.<br><br>Best regards,<br>X'
  }
}

Update #1:
For some reason this worked ONCE yesterday while testing but not on subsequent attempts. The SharePoint site name appeared as the sender! Strangest part is I left the From field blank. I wonder if my organization admin made changes of if Microsoft has finally fixed this...

Update #2:
Failing which, is there a way to ensure the SharePoint site name appears as the sender every time? Right now the flow does that, but on every alternate request it goes back to 'Online, Sharepoint (Gen)'

nouptime
  • 9,929
  • 5
  • 22
  • 37
  • What is your output? Does it throw error or send email but with different details. If you face error, please add the screenshots. – Gandalf Jun 16 '21 at 09:34
  • There's no error actually, emails fire perfectly fine but the sender still appears as 'Online, Sharepoint (Gen)' in Outlook – nouptime Jun 16 '21 at 10:13
  • Check my answer now, i think i found the mistake. Let me know if it works. I haven't tried the tutorial yet, but will do if that doesn't work – Gandalf Jun 16 '21 at 10:23

1 Answers1

3

I am not sure if at the time of tutorial writing nested properties were fetched in that way but they are fetched in totally different way now.
I presume the mistake you did was to copy the code of POST body from tutorial. Had you written it yourself by placing the properties from Dynamic Content popover, you wouldn't have faced this issue.

Check below how each property is fetched in Power Automate. You can use 2 approaches to fix your code though i would recommend the 2nd approach.

  • Either you can place individual property to your code
  • You keep the POST body schema intact, remove the variable mapping and map them again dynamically.

Also you can fetch the To property from GetItem itself instead of triggerOutputs

@{outputs('Get_item')?['body/From/Email']};   
@{outputs('Get_item')?['body/To/Email']};  
@{outputs('Get_item')?['body/Title']};  
@{outputs('Get_item')?['body/Body']}
Gandalf
  • 2,399
  • 2
  • 15
  • 19
  • Thing is, my structure and variables are completely different in the POST body. I used the tutorial for the syntax in the SharePoint HTTP connector. I even used the Dynamic Connector popover to re-map each variable numerous times but to no avail. Anyway, I've updated my question, I'm fine with having the SharePoint site name as the sender but even that seems wonky. – nouptime Jun 18 '21 at 16:33