cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ESpigle
Level: Powered On

Email Auto Response After Hours

I'm trying to figure out if it's possible with Flow to setup an auto response on one of our shared Office 365 mailboxes to send an auto response after hours (ie: between 5:00pm and 7:00am) every day when an email comes in. I've seen some older examples and attempted to imitate setting them up as demonstrated, but it appears some various options no longer exists (like setting up a Recieved Time using a greater than operator).

 

Any which way, before I dig any deeper with failed attempts, I want to find out if it's even possible to setup such a flow that handles auto responses only during certain specific hours (and maybe as a bonus, all during the weekend as well).

2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
Super User
Super User

Re: Email Auto Response After Hours

Hi @ESpigle

 

We had here a same question with answer

 

I think this solve your request.

 

Best Regards,

 

Gustavo Moraes


Did I answer your question? Mark my post as a solution!

Gustavo Moraes, o astronauta brasileiro do Flow!


Community Support Team
Community Support Team

Re: Email Auto Response After Hours

Hi @ESpigle,

 

This thread could be a reference for you:

https://powerusers.microsoft.com/t5/Microsoft-Flow-Knowledge-Base/How-to-tell-if-the-current-time-is...

 

 

Best regards,

Mabel Mao        

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
9 REPLIES 9
Highlighted
Super User
Super User

Re: Email Auto Response After Hours

Hi @ESpigle

 

We had here a same question with answer

 

I think this solve your request.

 

Best Regards,

 

Gustavo Moraes


Did I answer your question? Mark my post as a solution!

Gustavo Moraes, o astronauta brasileiro do Flow!


Community Support Team
Community Support Team

Re: Email Auto Response After Hours

Hi @ESpigle,

 

What’s your current situation? Have you tried what @gamoraes suggested?


If you are still having issues, please feel free post back. We are always ready to help.

 

Best regards,
Mabel Mao

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
ESpigle
Level: Powered On

Re: Email Auto Response After Hours

Sorry I didn't get back sooner. That seemed to do the trick for time of day as a condition. I just now need to figure out how to determine if it's weekend versus weekday (ie: we want to send them all day if it's the weekend) and then I'm all set.

 

Thanks!

Community Support Team
Community Support Team

Re: Email Auto Response After Hours

Hi @ESpigle,

 

This thread could be a reference for you:

https://powerusers.microsoft.com/t5/Microsoft-Flow-Knowledge-Base/How-to-tell-if-the-current-time-is...

 

 

Best regards,

Mabel Mao        

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
ESpigle
Level: Powered On

Re: Email Auto Response After Hours

Here is my final script that appears to be working (though not fully tested). If it's Sat., Sun. or outside of business hours, it will pass the condition and move on to the next step:

 

@or(
	equals(
		dayofweek(
			UtcNow()
		),
	0),
        equals(
		dayofweek(
			UtcNow()
		),
	6),
	less(
		formatDateTime(
			addHours(
				triggerBody()?['DateTimeReceived'],-6
			),
			'HH:mm'
		),
		formatDateTime('08:00:00','HH:mm')
	),
	greater(
		formatDateTime(
			addHours(
				triggerBody()?['DateTimeReceived'],-6
			),
			'HH:mm'
		),
		formatDateTime('17:00:00','HH:mm')
	)	
)
DanVentham
Level: Power Up

Re: Email Auto Response After Hours

Hi,

I wish to have a set message/email reply to inbound emails when we are closed. So after 5.30pm and before 8.30am Mon to Fri. And all day Sat and Sun.

I came acrosss this discussion and I think its what i want.  I wondered what the -6 meant in the string?

 

triggerBody()?['DateTimeReceived'],-6

 

Is the timezone related?  (we are un the UK)

 

Thank you

ESpigle
Level: Powered On

Re: Email Auto Response After Hours

The -6 is offset from GMT, correct.

DanVentham
Level: Power Up

Re: Email Auto Response After Hours

Great thank you. 

I tried using that code - 

@or(equals(dayofweek(UtcNow()), 0),equals(dayofweek(UtcNow()),6),less(formatDateTime(addHours(triggerBody()?['DateTimeReceived'],),'HH:mm'),formatDateTime('08:30:00','HH:mm')),greater(formatDateTime(addHours(triggerBody()?['DateTimeReceived'],),'HH:mm'),formatDateTime('17:30:00','HH:mm')))

 

but flow didnt like it - 

The template validation failed: 'The template action 'Condition' at line '1' and column '1813' is not valid: "Unable to parse template language expression 'or(equals(dayofweek(UtcNow()), 0),equals(dayofweek(UtcNow()),6),less(formatDateTime(addHours(triggerBody()?['DateTimeReceived'],),'HH:mm'),formatDateTime('08:30:00','HH:mm')),greater(formatDateTime(addHours(triggerBody()?['DateTimeReceived'],),'HH:mm'),formatDateTime('17:30:00','HH:mm')))': expected token 'Identifier' and actual 'RightParenthesis'.".'.

 

But I assume it liked your code?

ESpigle
Level: Powered On

Re: Email Auto Response After Hours

When we had last used it, correct--it worked as provided. We have since stopped using this as there was no provision / means to only send one response to an address a day and we actually occassionally saw this get stuck in autoresponse shootouts with other email addresses that were setup to autorespond and on rare occassion we had people sometimes come into work the next day with loads of emails back and forth autoresponding to other autoresponding emails.


I can't validate at this very moment in time if that code above still works as a result of no longer using this flow.

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020

thirdimage

Flow Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Flow Community Video Gallery!

Users Online
Currently online: 228 members 4,063 guests
Please welcome our newest community members: