If click on "Add link in email" link, auto populate the opened for user in "To" under compose email

mania
Tera Contributor

Hi,

If i click on "Add link in email" link, auto populate the opened for user in "To" under compose email.

I tried to find the "Add link in email" link in cxs_ui_action_config but is am in right place to configure the scenario?

Can anyone please help on this, It will be useful for me.

mania_0-1741539162555.png

 

mania_1-1741538904351.png

 

mania_2-1741538921430.png

 

Thanks in Advance!

3 REPLIES 3

Itallo Brandão
Kilo Guru

Hi,

Yes, you’re on the right track looking at the Search Action Configuration (“cxs_ui_action_config”). This “Add link in email” button often lives there for certain Workspace experiences. Here’s a suggested approach:

  1. Locate the Correct Action Record

    • In your instance, open Search Action Configuration (or a similar table) and find “Add link in email.”
    • Verify that the “Action label” or “Action value” matches the UI label you see in Workspace.
  2. Add or Modify the Action Script

    • Often, you’ll see a UI Action Visibility script and possibly a UI Action Script (or “Client Script” for the action).
    • In the script that runs when the button is clicked, set the email’s “To” field to the opened_for user.
    • For example:
       

 

// Example:

var openedFor = current.getValue('opened_for');

// Then call or set the email 'To' field:
// This might involve referencing an 'EmailEditorUtil' script or 
// another function that sets the compose form fields.
someEmailFunction.setTo(openedFor);

 

  • The exact API or function depends on how your environment handles composing an email in Workspace.
  • Check EmailEditorUtil or Other Script Includes

    • If your environment uses a Script Include like EmailEditorUtil, you may need to extend its logic to accept the opened_for value and populate the “To” field.
    • Confirm that the script is accessible from your scope and is client-callable if you’re referencing it from a client script.
  • Test in Workspace

    • After updating the action script, click “Add link in email” in Workspace to confirm that the “To” field automatically fills with the opened_for user.
    • You might need to refresh the Workspace or reload the browser to see changes.

If you still don’t see the action or the email compose field doesn’t populate, double-check:

  • You’re editing the correct configuration record (some Workspaces have multiple “Add link in email” actions).
  • Your user has the right roles to see the updated script.
  • Any script references (e.g., EmailEditorUtil) are valid and accessible in the same scope.

I hope this helps you set up the auto-populate of the “Opened for” user in the email’s “To” field. Let me know if you have any questions!

Best regards,
Itallo Brandão

Shivalika
Mega Sage

Hello @mania 

 

Yes, you are in the right direction. Add link in email id indeed contextual search results - which allows us to add KB Articles suggested link in email.

 

In the related list you can find the UI action thats related to it and you can modify it to return the opened for field value. 

 

Next step, which I think you are already on it would be to make the email composer widget accept this value and change the to part, which would be in search configuration. 

 

I hope this answers your queries and also explains the flow overall. 

 

Kindly mark my answer as helpful and accept solution if it helped you in anyway,

 

Regards, 

Shivalika 

 

My LinkedIn - https://www.linkedin.com/in/shivalika-gupta-540346194

 

My youtube - https://youtube.com/playlist?list=PLsHuNzTdkE5Cn4PyS7HdV0Vg8JsfdgQlA&si=0WynLcOwNeEISQCY

Shivalika
Mega Sage

Hello @mania 

 

Kindly accept solution if it helped you in anyway, so that it can be moved from unsolved bucket to solved 😊

 

Regards, 

Shivalika 

 

My LinkedIn - https://www.linkedin.com/in/shivalika-gupta-540346194

 

My youtube - https://youtube.com/playlist?list=PLsHuNzTdkE5Cn4PyS7HdV0Vg8JsfdgQlA&si=0WynLcOwNeEISQCY