cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

How to Configure Cron Job for triggered multiple email ID

Former Member
0 Kudos
410

Hi Experts ,

As We know We triggered one single email id with cronjob .

So my question is , How to configure multiple email id instead of single email id with Cron Job .

If anyone have any idea , please reply so that i can implement this functionality . .

Any reply is greatly appreciated.

Regards,

Satish

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member387866
Active Contributor
0 Kudos

Hi Satish,

You should use the EmailService in the CronJob JobPerformance coding.
When you have the values you want to return, then send the emails and finally make the PerformResult return.
You can store the email addresses you want to send them to via the Database in a model for this job to receive via FlexibleSearch.

 // Send Emails
 List<EmailAddressModel> toAddresses = // Get addresses from hardcoding, or database model.
 emailService.send(emailService.createEmailMessage(toAddresses, ...));
 // Return Result.
 return new PerformResult(CronJobResult.SUCCESS, CronJobStatus.FINISHED);

You will need to add in error checking, but that is a basic code sample.

Regards,
Luke

Former Member
0 Kudos

I am not familer about the process of configuring e-mail to the cronJob. Can you please help me where can we configure the e-mail address in Cron Job.

This will be really help full to automate our monitoring process.