-1

I have created an email template on User object as below:

Hello,

A user registered successfully with below details:

First Name: {!User.FirstName}

Last Name: {!User.LastName}

Email address: {!User.Email}

Thanks

I am fetching the above email template inside flow and using core send email action trying to send an email alert. Below is setting in flow send email action:

enter image description here

enter image description here

This is a record triggered flow on user object. When I edit or create an user I want to send an email alert with information as first name, last name and email of the edited or created user.

What is happening right now is it takes the first name, last name and email information of logged in user who is editing or creating user record. Is there any ways I can make this work to send information of the user which is being edited or newly created via email?

1 Answer 1

1
  • $User.xxxx fields are always the running user
  • User.xxxx fields do not act as you expect in Email templates as per this Email Template Merge Fields for User-Based Workflow Rules doc
    • To reference the user who created or updated the record that triggered the workflow rule, use User fields.
  • $Record.xxx fields are of the target object of the record-triggered flow. In your case, the user record being edited

You have some options

Option 1 - Dispense with the email template altogther

  • Use a Text Template in Flow with merge fields of the $Record.xxx values
  • Set the email body to be this text template

Option 2 -- Change the email template merge fields

If the Email Template's base object is User, then the merge fields should be

  • {!Receiving_User.FirstName}
  • {!Receiving_User.LastName}
  • ...

I did a simple test on a User with FirstName = Foo using this email template:

First Name as Target_User: {!Target_User.FirstName} First Name as User: {!User.FirstName} First Name as Receiving User: {!Receiving_User.FirstName} 

and got these results:

First Name as Target_User: First Name as User: MyFirstName First Name as Receiving User: Foo <= desired result 
2
  • So, tell me one thing how can we add case details merge fields in email template while sending it by flow Commented Mar 13, 2024 at 16:36
  • @piyushsaini - ask a new question rather than requesting scope creep on an old one Commented Mar 14, 2024 at 15:15

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.