I’m building an admin area and it’s going really well. I’m using the Security Enforcer for it (of course!) and have created a server action to send me an email when someone logs in and that works fine.
But I really want the email to contain the id or username of who has just logged in but I’m just not having any success.
In the login server action I have…
database connection
security provider
security login
database query
and I’ve added ''set value" and given it a value of {{siteSecurity.identity}}
Then, in the server action which sends the email, I’ve tried inserting a global variable of all types but it’s not inserting anything.
When using the ‘Set Value’ server action, how is that stored? Is it a session variable?
Hi @sitestreet
In your email body you can directly use: {{siteSecurity.identity}} expression. No need to put it in a set value step.
The set value is just a variable, not a session variable.
You can also use something like: {{query1.data[0].username}} in the mail body.
Thanks @Teodor. I had my Send Email step in a different server action. I’ve now put it into the same server action as the security provider and the ID now inserts into the email.
I also have a database query in that server action but I’m not able to insert any fields from it into the email. Attached is what I see in the data bindings.
I just want to show the real name of the logged in user (or email address) rather than just have their ID. I was expecting the Database Query to have sub-branches containing all the fields.
We are going to improve this and make it available in the data picker, by adding a special “query single record” step in server action. So you won’t have to add this manually any longer