- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2025 07:14 AM - edited 02-05-2025 07:15 AM
Hello,
Based on the "taxi company" field's choice list value, I want to return a different email address on Email Client Script > Recipients > To field.
Any ideas how can this be done?
One note related to this.
I have already created a script include to call from To field.
Script include:
For some reason this does not work. I see that gs.info is not displayed either.
Any ideas why? (my app is a custom app, so the scope is not global).
Best,
Firat
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2025 07:10 AM
Are the email client template and the script include in the same scope? The script include is not accessible form all application scopes.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2025 07:57 AM
Hi @Sheldon Swift ,
I made the script include accessible from all scopes and then used the scope API before calling, then it worked fine.
But it is still a mystery why it does not work when it is accessible only from the scope application 😕
Best,
Firat
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2025 09:59 PM
I’m not sure that’s true. The OOB example, EmailClientTemplateEvaluator, isn’t client callable. I’ll test tomorrow if I get a chance…it will be interesting to know.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2025 06:40 AM
Hi @Sheldon Swift and @Ankur Bawiskar
Thanks a lot for your help!
I tried both of your suggestions but none worked. I cannot even get to print the gs.info, which means that probably I cannot even call it.
I tried this " javascript:" as well.
I tried is client called and not-callable, but in all cases, got this: From field in client template [Taxi Request Template] evaluates to an invalid address []. Using default from address
Any idea why?
Thanks.
Best,
Firat
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2025 06:56 AM
Hi Firat, are you sure template you're working on is the template being applied? You can try setting some identifying text in the subject to be sure.
Also, the forum here automatically encodes the colon as a security mechanism. Usage is as pictured - ":" should be ":" and usage with your class name (note the method names) is as pictured.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2025 06:48 AM
@Ankur Bawiskar, the below is working as expected in this scenario. I anticipate the requirement will be similar to the OOB example, where @mfhaciahmetoglu will extract a value and execute a GlideRecord query to retrieve the appropriate email address.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2025 06:59 AM
Hey @Sheldon Swift ,
Many thanks again for following-up.
I followed exactly the same approach (except that my script include is in my custom application scope)
And here is the recipients:
Here is the result:
I get the following logs:
Best,
Firat