Asset Builders, Metadata, and Triggers

What I am wanting to do, it send an email based on the data in a metadata field of a newly created asset.


The trigger has been set up correctly, so that if "Yes" is entered into the field, an email will be sent off with the assets contents. However, this has only worked when testing it using Trigger batching. It does not work when creating the asset using an asset builder. I assume the problem here, is that with an asset builder, the metadata is added AFTER the asset is created? So, my trigger is failing because it does not see the metadata on asset created, if it is being added after creation.



Does this make sense?


Correct. You may need to work with a cron delay: Set the asset builder to create assets Under Construction, then the on create trigger sets a future status of Live for the next cron run. You then fire the email trigger on the Live status change.

This seems like a good option. Although I will have to make sure I separate assets that need the email trigger going live, and the assets that should not send the email going live.

I ended up just setting a trigger that gets fired on Asset Metadata Updated. So, it works just like Asset Created, as the metadata is added right after creation, so my email gets sent almost instantly if the user has selected yes to send the email.

Nice work. :)