Forum Discussion
Update list when Send email with options sends successfully
From the docs, the "Send email with options" action sends an email with multiple options and waits for the recipient to respond back with one of the options. I'm trying to log the sending action by updating a Yes/No column and setting a date column with a timestamp.
Something like this:
- Trigger: new item created
- Email sends
- list updates item that was created, sets "email sent" flag to Yes, sets timestamp.
- Recipient responds, capture response and update list
Unfortunately the action waits until the response, so I cannot log when the email was actually sent. I don't want to do the update before the message is sent, because I want to make sure the send action is successful. But I don't want to wait until after the recipient of the message responds, because it's not accurate.
Any suggestions?
- Matt WestonIron Contributor
Hi Jason Barnes you could consider a parallel action which runs at the same time as the send email (see screenshot). So run the first update to the list item which runs concurrently with the sending of the email, and then update based on the response once the email button is clicked by the user.
- Jason BarnesBrass Contributor
The problem with that approach is it doesn't actually tell me if the email was successfully sent. It only tells me when the flow ran. So one branch, the update, could be successful, but the other branch, which sends the email, might not be successful.
- Matt CoatsIron Contributor
What if you used a proxy timestamp instead? If you're willing to sacrifice up to a couple seconds, you can use the Current Time action immediately after your Send Email with Options action is completed and use that to populate your "Email Sent" field in your List.
*Possibly dumb question, are you trying to log the time the email was sent, or the time that the recipient of the Send Email with Options email responds?
- Jason BarnesBrass Contributor
I'm actually trying to log when the email was sent AND when the recipient response. I'd like to have a view where it shows all the info - email sent (yes/no), email sent date, response (a, b, or c), response date.
In theory I could set a variable when the send email runs and update the list after the response using that variable, but it doesn't give the visibility I'm after to know which items have had an email sent but not responded to. Hopefully that makes sense and adds some clarity.
- Matt WestonIron Contributor
You could always work on the assumption that it fails, and handle the error of the email being sent accordingly (See screenshot). If the email is going to fail to send, you'll get the failure almost immediately and so you can a further update to either log the error in the list or remove the sent date. This would be your "has failed" step, whereas the "is successful" will continue to wait until the response comes back.
It's not quite the nice and shiny solution which you're looking for but it should do the job.