I would tackle this by building a CASE statement into a step in the JO query:
The CASE statement would use the CSM Email address if it’s not null, and a generic email address if it is null.
Then you’ll end up with a “new” field that’s always populated with an email address, and you can use that as your Sending email address. Take note, you may want to do something similar with the Sender’s Name.
To add to what Matthew said, in Dynamic JO, this won’t exactly work as is since the case statement can only generate strings (text) that are not recognized as emails when mapping tokens or header fields in Dynamic JO.
The case statement should seek to generate a GSID for a user, either a real person that’s a real Gainsight user, or a “dummy user” you’ll have created as an internal collaborator in your user table.
From that transform task containing the case statement with your “fallback GSID”, you’ll merge a fetch from your user table on “GSID”. This will give you a pretty robust and easy to evolve fallback logic. And will ensure the email is actually recognized as an email in Dynamic JO, and is mappable.
Hope this helps!
A