How to dynamically change 'from' address in email alert?
I know how to change the 'from' address in an email alert using organization-wide emails, but I am wondering if it is possible to dynamically change this address in a workflow. We are dynamically populating an email field on SF records and would like to trigger an email alert in which this dynamically-generated email is the 'from' address. How do you advise we proceed? I have read about some possible solutions via Apex, VisualForce, and MarketingCloud, but I am not sure what is the easiest or best way forward. Note: the dynamically generated email addresses will all be on our own email domain.
Background info: My team is implementing an email relay feature so that when a customer receives an email from us (sent via SF), the customer can reply to the email and it will push the data back to SF. This requires the customer to be writing to a uniquely generated email address like email@example.com. We have written the script which creates the unique email addresses and pushes the data from the unique email address to the relevant record in SF. Now we just need to figure out how to have this unique email address be the 'from' address for the initial email we are sending them.
The suggested solution is saying a custom formula field could be used to handle the logic to determine your From address. However, it doesn't reference how then to use that custom field.
I would still suggest doing this Apex.