I want to update a metafield to track when an email was sent

Hi, I am a beginner with Shopify Flow. I wanted to track when an email was sent by updating a customer’s metafield (e.g. emailLastSentAt). I do not know how to confirm if this is the correct value:

{{ “now” | date: “%Y-%m-%d %H:%M” }}

Tips on other ways to do this and to test/confirm the dynamic values would be much appreciated.

Are you sending the email via Flow or some other tool?

Hi, I’m using Flow to send the emails.

Are you using an app to send these emails to customers?
As Shopify flow doesn’t do general customer emails at this point, only transactional emails

Oh sorry, I actually meant to say I am using Shopify Email to send the emails and Flow to manage the automation. After an email is sent I want to update a custom metafield of the customers with the value “now” or current time. I would then use that to check against for a condition.

Ah okay, sorry just wanted to check here so you weren’t breaching any rules.

You can do something like this

Where the metafield is date and time, the format you’d need is {{ ‘now’ | date: “%Y-%m-%dT%H:%M:%S” }}

I’ve just tested it on my own development store

Big thanks! That is exactly what I am looking for.

Hey man, idk how to dm you here but I wanted to ask if how were you able test and get this result?

I just set up the flow on my store, but triggered by a schedule rather than email.

You can then see the steps and inputs and outputs in Shopify Flow app when you view a run.

Alright thanks, I see the data now in the steps.

1 Like