cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Hepworthnot
Helper II
Helper II

Creating but not sending an email

Hi,

 

is it possible to write a flow which creates an email but doesn't send it.

 

Sometimes I want to edit the template emails I create with a flow so I want the template to open ready for editing before I send it?

 

Thanks

Phil

1 ACCEPTED SOLUTION

Accepted Solutions
Hepworthnot
Helper II
Helper II

OK,

 

this seems to work ...

SharedScreenshot.jpg

View solution in original post

35 REPLIES 35
ScottShearer
Super User
Super User

@Hepworthnot:

 

There is no "out of the box" action that will allow you to create an email and save it as a draft.

 

If you can accomplish this, it would involve calling an Ofice 365/Exchange web service via an HTTP action.

 

If this addresses your issue, please mark you post as Solved.

 

Scott

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott
miketondu
Frequent Visitor

Has this been resolved ?  It would be great to run a flow and have it give me the option to approve the template that's about to be sent and edit it instead of automatically sending it.  Otherwise I have to hard code 16 different types of emails depending on their characteristics 

Thank you for replying Scott.

 


@ScottShearer wrote:

@Hepworthnot:

 

There is no "out of the box" action that will allow you to create an email and save it as a draft.

 

If you can accomplish this, it would involve calling an Ofice 365/Exchange web service via an HTTP action.

 


Are you saying a solution would be to call an Office 365/Exchange web service via an HTTP action? If so can you point me in the right direction to learn how to do that please?

 

Thanks Phil


@miketondu wrote:

Has this been resolved ?  


No, not yet.

@Hepworthnot 

Here is a link to the API documentation for Outlook mail.

Here is a link to documentation for the HTTP action

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott

Hi @Hepworthnot ,

 

you can do that  using  MS GRAPH API (premium action  'Invoke an HTTP request'). 

Here is the info how to create a message using GRAPH: 

https://docs.microsoft.com/en-us/graph/api/user-post-messages?view=graph-rest-1.0&tabs=http

 

--------------------------------------------------------------------------------------
Contact me if you are interested in custom Power Automate development.

Curious if anyone has tried this?  When I run the "Invoke HTTP" action from Flow using one of their examples, I get an odd error message stating:

 

"code": "UnableToDeserializePostBody",
"message": "were unable to deserialize ",
 
I get the same thing in Graph Explorer, and this doesn't seem to be a permissions issue.  Any ideas how to fix this?

Could  you show your flow?

--------------------------------------------------------------------------------------
Contact me if you are interested in custom Power Automate development.

Invoke HTTP Request.png

Sorry I can't reproduce the problem - it works just fine for me.

--------------------------------------------------------------------------------------
Contact me if you are interested in custom Power Automate development.

Good to know that I'm not completely off-base with this approach.  Curious, when you setup the Invoke HTTP Connector what did you use for the Base Resource URL and the Azure AD Resource URI (Application ID URI)?  

 

I think I used "https://graph.microsoft.com" for both fields based on what I saw in another post, but I have no idea if that is correct.  

Hi @rjhale,

 

yes, correct. "https://graph.microsoft.com" for both fields. 

--------------------------------------------------------------------------------------
Contact me if you are interested in custom Power Automate development.

Ok.  I figured it out.  For anyone else who might be attempting this the body has to look like this: 

 

{
	"Subject": "Test Subject",
	"Body": {
		"contentType": "Text",
		"content": "Testing the body of this message"
	},
	"ToRecipients": [{
		"EmailAddress": {
			"address": "test-whatever@contoso.com"
		}
	}],
}

 

 @VictorIvanidze Do you happen to know if it's possible to use a similar approach to create draft messages within a shared mailbox? 

Nevermind.  I think I got it worked out.  You can just treat it like any other user:

https://graph.microsoft.com/v1.0/users/sharedmailboxaddress/messages

Hepworthnot
Helper II
Helper II

Hi,

 

thanks for the help above. I can create the draft as above.

 

I am struggling to add dynamic content though. I get this error message for example:

 

The input body for trigger 'manual' of type 'Request@ did not match its schema definition. Error details: 'Invalid type. Expected String bu got Null.'

 

Can you help please?

 

Thanks

Phil

Hi @Hepworthnot, where do you see this error? 

--------------------------------------------------------------------------------------
Contact me if you are interested in custom Power Automate development.
Hepworthnot
Helper II
Helper II

Hi @VictorIvanidze 

 

In PowerApps studio. After trying to run the flow using the button in PowerApps I see an error message on the button.

Hepworthnot
Helper II
Helper II

Did you find anything @VictorIvanidze ?

Please show your flow.

--------------------------------------------------------------------------------------
Contact me if you are interested in custom Power Automate development.

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Users online (2,234)