Workflow - Send Email - Dynamic Email Content

Hi All,

I’d like to use workflows to send an email when some identity attributes change. I was wondering if the Send Email action supports dynamically building the email based on (for example) an identity attribute.

I.e.
if staff type = X: include text in email body such as ‘You’re a X user type’
if staff type = Y: include text in email body such as ‘You’re a Y user type’
etc

Is this possible in the workflow send email step?

I’ve tried adding in velocity type statements to the body and to the template context but they seem to result in the email step not firing (when I do a test workflow).

If you don’t mind, can you share a screenshot of how you configured the email body and templating context? This should be possible, but maybe it’s a configuration issue.

Hm fresh eyes seem to have got this working. The tester was not progressing to the email step when I was trying last night but now it seems to work. I included velocity in the body and not the templating context and that seems to work for me now. I guess I just needed someone to say it should work for me to keep trying. :slight_smile:

Now another small question - is there a way to get current date in a workflow for use in an email template. I.e. an inbuilt velocity or template variable or something? I’m thinking I could look for a public API which allows fetch of current date, and use a HTTP action to fetch it on the fly. Like http://worldtimeapi.org/ - keen to know if there’s a way to do it without an API call though.

Glad to hear it’s working now. I don’t believe there is a way to get the current date within workflows, other than using the HTTP action to call a date API like you mentioned. You can certainly suggest this idea by clicking the “Provide Feedback” button on the main workflows page.