18
Views
6
Comments
Solved
How to send generated password in email template
Application Type
Reactive

Hi Everyone, working on  a temporary password generation method where i want to send password in  email template for a user  to login with that credentials 

How to append the dynamically generated password to email template and send a mail to user 

As generate password is available in sever action and email template in interface how to bind the generated password to email template? 


Thanks advance

2026-01-28 16-57-48
Mihai Melencu
Champion
Solution

Hello @Anush Kumar ,

It really depends on what triggers this email and password generation, but for a general case you can follow this guide:


  1. Include an Input Parameter for the Password

    • Ensure the email logic includes an input parameter specifically for the generated password (e.g., TempPassword).
  2. Create the Server Action for Sending the Email

    • In the UI flow, right-click the email widget and select "Send Email and Fill With Data".
    • This will generate a server action to handle email sending.
  3. Generate the Temporary Password

    • Drag the server action responsible for generating the password into the flow.
    • Verify that this action has a well-defined output parameter (e.g., GeneratedPassword) to return the temporary password.
    • If the password generation logic does not include an output parameter, create one.
  4. Bind the Generated Password to the Email Parameter

    • Use an Assign node or directly map the output parameter (GeneratedPassword) from the password generation action to the input parameter (TempPassword) of the Send Email server action.

Optional Enhancements

  • Error Handling: Add error handling for cases where email sending fails. 
  • Password Storage: If required, temporarily store the generated password securely (e.g., hashed) in the database to allow for verification.
  • Security Best Practices:
    • Ensure the password meets complexity requirements (e.g., length, special characters, etc.).
    • Force the user to reset the password upon first login for added security.
    • Avoid logging or exposing the password in server logs.
UserImage.jpg
Anush Kumar

@Mihai Melencu  Thanks for the solution it worked..!!

2021-11-12 04-59-31
Manikandan Sambasivam

Hi,

In your email template, you must include the password's placeholder as {password}. Then, pass the generated password to the email and replace {password} with the generated password.

UserImage.jpg
Anush Kumar

how to pass the generated password as it is in sever action & email template in interface 

2021-11-12 04-59-31
Manikandan Sambasivam

Keep the input parameter in the email template and replace the password placeholder 

2026-01-28 16-57-48
Mihai Melencu
Champion
Solution

Hello @Anush Kumar ,

It really depends on what triggers this email and password generation, but for a general case you can follow this guide:


  1. Include an Input Parameter for the Password

    • Ensure the email logic includes an input parameter specifically for the generated password (e.g., TempPassword).
  2. Create the Server Action for Sending the Email

    • In the UI flow, right-click the email widget and select "Send Email and Fill With Data".
    • This will generate a server action to handle email sending.
  3. Generate the Temporary Password

    • Drag the server action responsible for generating the password into the flow.
    • Verify that this action has a well-defined output parameter (e.g., GeneratedPassword) to return the temporary password.
    • If the password generation logic does not include an output parameter, create one.
  4. Bind the Generated Password to the Email Parameter

    • Use an Assign node or directly map the output parameter (GeneratedPassword) from the password generation action to the input parameter (TempPassword) of the Send Email server action.

Optional Enhancements

  • Error Handling: Add error handling for cases where email sending fails. 
  • Password Storage: If required, temporarily store the generated password securely (e.g., hashed) in the database to allow for verification.
  • Security Best Practices:
    • Ensure the password meets complexity requirements (e.g., length, special characters, etc.).
    • Force the user to reset the password upon first login for added security.
    • Avoid logging or exposing the password in server logs.
UserImage.jpg
Anush Kumar

@Mihai Melencu  Thanks for the solution it worked..!!

2022-12-30 07-28-09
Navneet Garg

There are already some post which discussed about it

https://www.outsystems.com/forums/discussion/100519/sending-email-temporary-password/

https://www.outsystems.com/forums/discussion/100427/sending-an-email-to-users-with-temporary-password-with-username/#Post436163

but I think sending a temporary password is not a good idea rather then send a link to set new password with a simple code (verification code) is better solution.

https://www.youtube.com/watch?v=QKqXKJdqBuY



Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.