Customizing the email digest template
The Email Digest template is located in [Job Scheduler]/Languages/[language]/emails folder, in the emaildigest_group.xml file. Unlike other email types, Email Digest is only sent out as HTML; the text version is never used. It is by far the most complex of the email templates, but can be broken down into a few simple sections.
- Blog posts
- Forum threads
- Comments or replies to blog posts, forum threads, media files, and wiki pages
- Media and new wiki pages
- Updated wiki pages
Each section is populated by a View extension (such as $email_userViews for new users). Each view returns a different structure of data.
How digest emails choose what data is reported
Email Digests use activity messages generated from user activity to gather information. What activity is reported is determined by the type of digest subscription (daily or weekly).
Daily digests report activity from the previous day. No matter what time during the day the digest email is sent out, it will only contain activity from the previous day, not the previous 24 hours. This allows the digest to be sent at any time during the day and keep consistent data.
For example, a daily digest sent on Tuesday at noon will contain activity from Monday; no activity from Tuesday will be shown in that digest. When the next digest is sent on Wednesday, all of Tuesday's activity will be in that digest.
Weekly digests report activity from the previous seven days. Similarly to daily digests, the time during the day the weekly digest is sent does not affect the content shown. Again, this allows the digest to be sent at any time during the day and keep consistent data.
For example, a weekly digest sent on the 19th of a month at noon will contain activity from midnight on the 12th through 11:59pm on the 18th. The next digest is sent on the 26th and will contain activity from midnight on the 19th to 11:59pm on the 25th.
Changing when digest emails are sent
Email digests are scheduled by the EmailDigestDailyJob and EmailDigestWeeklyJob. The Email Digest jobs are scheduled in the tasks.config file in the Job Scheduler folder. By default, the daily job runs at midnight every night; the weekly job runs at midnight every Sunday. Either of these times can be changed using the cron expression notation. They should only be run once a day, but can be run at any time.
For example, to send the daily digests out at 8 a.m., change the schedule value of the EmailDailyDigestJob in tasks.config to "0 0 8 * * ? *". To send the weekly digests out at noon on Friday, change the schedule value of the EmailWeeklyDigestJob in tasks.config to "0 0 12 ? * FRI".
Refer to this documentation for a more detailed explanation of cron expressions.
Note: Times are based to the server running the jobs timezone. Scheduling the job for 8am will cause it to run at 8 a.m. based on the server's time.
Troubleshooting Email Digest
Email digests are scheduled by the EmailDigestDailyJob and EmailDigestWeeklyJob. Verify the jobs are set to run.
If, after making a change to the Email Digest template emails are not being sent, check the Exceptions report in the Control Panel. Filter to the "Email unable to send" exception type to remove any unrelated exceptions.