How to add manager dynamically in cc by using mail script
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-17-2022 06:02 AM
Hello,
Can anyone help me with this query?
6 REPLIES 6
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-17-2022 07:38 AM
hello @Sravani Reddy try this
email.addAddress('cc',gr.assigned_to.manager.email.toString(), gr.assigned_to.manager.name.toString());
Hope this helps
Mark my answer as correct if this helps you
Thanks
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-17-2022 07:39 AM
I wonder if it's because you have the the email.addAddress() code in a loop.
Can you replace that line with
var managerEmail = gr.assigned_to.manager.email.toString();
and then after your loop try
email.addAddress('cc',managerEmail);