Send emails batch wise and give break 1 hour.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-16-2024 08:00 AM
Send emails batch wise, send 500 mails then give 1 hour break then send another 500 users. I have tried with fix script gs.sleep it was impacting the system performance. The output of all emails i have stored in Array. I am tried with flow designer by using for each condition the output I am getting 234 mails only. I have checked the related system property the count upto 16000+.
Please suggest how to send without using system performance.
@Ankur Bawiskar sir please suggest
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-18-2024 02:44 AM
@Ankur Bawiskar sir, please suggest how to send mails with some delay,
I have added users mails id's in for each item,
in the loop i have added 'Send Mail" action- it was sending all the users at a time.
if i am adding 'wait for' after the 'Send Mail' action it was sending 1 batch mail then waiting the duration and getting error as 'One or More Email address was Invalid'
if we are sending directly going all the mails, adding wait for condition getting error.
how send each mail after some duration of time. by using flow designer or fix script.
when in the fix script i am using 'gs.sleep' it was impacted the system performance.
please suggest.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-18-2024 05:54 AM
this error means email address is invalid -> One or More Email address was Invalid
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-18-2024 06:01 AM
Hi @Ankur Bawiskar sir, if we are not adding the wait condition, the all mails was going.
If error is there it was not sent previously also. I hope after the wait duration it was not taking proper input.
Can you please suggest.
After for each loop what are the steps I have to add.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-19-2024 07:23 AM - edited ‎12-19-2024 07:26 AM
@Ankur Bawiskar sir, in the for each loop sending 1st batch mails taking String input. But after some delay when coming to send 2nd batch mails the input taking as an Array. So that the issue getting error as one more email addresses or Invalid.
Can you please suggest how to overcome this issue.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-16-2024 08:28 AM
Hi @prudhviraj1 ,
I am not sure what's your business requirement to sent these many mail but you can try something like below.
- Limit to 500 or less to avoid overwhelming system resources.
- Avoid gs.sleep: It blocks the thread, leading to performance issue.
- Use Asynchronous Methods: Use eventQueue or Flow Designer for non-blocking email processing.
-------------------------------------------------------------------------
If you found my response helpful, please consider selecting "Accept as Solution" and marking it as "Helpful." This not only supports me but also benefits the community.
Regards
Runjay Patel - ServiceNow Solution Architect
YouTube: https://www.youtube.com/@RunjayP
LinkedIn: https://www.linkedin.com/in/runjay
-------------------------------------------------------------------------