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

When run catalog version sync how to have a notification email?

Former Member
0 Likes
1,069

I still using hybris 5.x version. When run catalog version sync, a cron job is created. By default notification check box is unchecked and email is empty. where is the configuration or how to have email notification for the catalog version sync job?

Accepted Solutions (0)

Answers (1)

Answers (1)

ihar
Explorer
0 Likes

CatalogVersionSyncJob model has to be updated

 UPDATE CatalogVersionSyncJob; code[unique = true]; sendEmail; emailAddress
                             ; syncJobCode        ; true     ; email@example.com

In case you need a custom email template

 UPDATE CatalogVersionSyncJob; code[unique = true]; emailNotificationTemplate(code)
                             ; syncJobCode        ; DefaultCronJobFinishNotificationTemplate

Don't forget to configure mail.* properties. Otherwise, an exception will be thrown

 [Job] Could not send email. Make sure your mail properties (mail.*) are correctly set.
 org.apache.commons.mail.EmailException: Make sure your mail properties (mail.*) are correctly set.
     at de.hybris.platform.cronjob.jalo.CronJob.sendEmail(CronJob.java:2246) ~[processingserver.jar:?]
     at de.hybris.platform.cronjob.jalo.Job.execute(Job.java:1398) [processingserver.jar:?]
     at de.hybris.platform.cronjob.jalo.Job.performImpl(Job.java:813) [processingserver.jar:?]
     at de.hybris.platform.cronjob.jalo.Job.access$1(Job.java:766) [processingserver.jar:?]
     at de.hybris.platform.cronjob.jalo.Job$JobRunable.run(Job.java:685) [processingserver.jar:?]
     at de.hybris.platform.util.threadpool.PoolableThread.internalRun(PoolableThread.java:208) [coreserver.jar:?]
     at de.hybris.platform.core.threadregistry.RegistrableThread.run(RegistrableThread.java:134) [coreserver.jar:?]
 Caused by: org.apache.commons.mail.EmailException: Configured E-mail server is empty.
     at de.hybris.platform.util.mail.MailUtils.validateEmailServer(MailUtils.java:61) ~[coreserver.jar:?]
     at de.hybris.platform.util.mail.MailUtils.getPreConfiguredEmail(MailUtils.java:214) ~[coreserver.jar:?]
     at de.hybris.platform.cronjob.jalo.CronJob.sendEmail(CronJob.java:2198) ~[processingserver.jar:?]
     ... 6 more
Former Member
0 Likes

I already set the notification to true and set email. But not sure why it's not working. when run sync in sync wizard, check the cron job, the notification is still set as false, and no email. in cron job, can set email notification in tab Task manually. then run the cron job I can receive email after job completed. Is there any step I missed? or require system update for example? after run the update impex, from hmc, can see notification is true and email is set for the catalog sync job. but no notification email after sync.

when doing sync, there will be a cron job. can see notification is still false for the job.

arvind-kumar_avinash
Active Contributor
0 Likes

Did you check the SMTP configuration?

Former Member
0 Likes

when I run cron job with email notification set, I can receive email. so I can supposed smtp is good?