Here is a daily digest email script... it's a very simple stand-alone script that runs on a cron every midnight.
What it Does
It grabs all the posts from the last 24 hours, neatly organizes them into a nice XF-styled email, and sends them to all users who chose to receive admin emails.
Example:
Here's a sample email screenshot (sent using an installed daily digest system, but hacked to display "Lipsum" instead of actual content)
.
Limitations:
This script uses Gmail to send the emails, which has limitations, so it's grouping the messages into clusters of 99 BCCs per mail. NOTE that you will be able to send a maximum of 9,990 messages per 24 hours in this way due to Gmail's licensing restrictions. (NOTE also that Gmail's actual restrictions are 100 emails per 24 hours or 100 BCCs per email... we're getting around this with 100 x 99 - they may some day dual-restrict so you can only send to 100 total people per day.)
If you have more members, you should change the settings to use an ESP that allows larger throughput (e.g. MailChip, ConstantContact, etc.). This will require some knowledge of the 3rd party ESP's configuration settings, and the ability to apply them to the script (assume if you need this, you can afford a programmer to get it set up for you.)
Installation
Installation is manual, but not too difficult.
1. Unzip and Configure
First, unzip the attached files. You'll need to edit xf_daily_digest.php to configure it with your website's settings.
Unzip
Simply unzip the files in xf_daily_digest.zip (using whatever zip client you have) into a directory on your computer.
Configure
Open up the file xf_daily_digest.php that you just unzipped and edit the circled values below. The instructions are outlined in the file, as well.
2. Upload (FTP) to Your Server
Next, move the files into your web root using an FTP client (I like Filezilla).
Simply locate the web root (either called "public_html" or "www") and drag-and-drop the "pear" folder and "xf_daily_digest.php" file from your local computer into that directory (they should show in the same directory as "upload", "styles", etc.)
3. Cron Job
Creating a cron job can be scary your first time. But it's easier than you may think! And it's necessary to do this so the script will run automatically every day.
A. cPanel Cron Setup (Novice)
If you're a novice with Linux, and you have a cPanel website admin from your web host (very common with LAMP hosts), find this section on your cPanel:
Click the "Cron Jobs" icon, and that'll take you to the form below.
Set the script to run at 0 4 * * * (see below), and enter the script name preceeded by "php" and a space (this tells the cron job to execute the php script).
The full "Command" text should be"
B. Manual Cron Setup (Expert)
If you are an experienced Linux admin, and you have shell access (or if you're on a dedicated server or VPS without cPanel), you can instead simply edit your crontab and add this line:
$ nano /etc/crontab
Save the file, quit, and restart the cron daemon:
$ /etc/init.d/cron restart
Done!
And that's it! Once you've done these 3 simple steps, the script should run every night!
Cheers.
What it Does
It grabs all the posts from the last 24 hours, neatly organizes them into a nice XF-styled email, and sends them to all users who chose to receive admin emails.
Example:
Here's a sample email screenshot (sent using an installed daily digest system, but hacked to display "Lipsum" instead of actual content)
Limitations:
This script uses Gmail to send the emails, which has limitations, so it's grouping the messages into clusters of 99 BCCs per mail. NOTE that you will be able to send a maximum of 9,990 messages per 24 hours in this way due to Gmail's licensing restrictions. (NOTE also that Gmail's actual restrictions are 100 emails per 24 hours or 100 BCCs per email... we're getting around this with 100 x 99 - they may some day dual-restrict so you can only send to 100 total people per day.)
If you have more members, you should change the settings to use an ESP that allows larger throughput (e.g. MailChip, ConstantContact, etc.). This will require some knowledge of the 3rd party ESP's configuration settings, and the ability to apply them to the script (assume if you need this, you can afford a programmer to get it set up for you.)
Installation
Installation is manual, but not too difficult.
1. Unzip and Configure
First, unzip the attached files. You'll need to edit xf_daily_digest.php to configure it with your website's settings.
Unzip
Simply unzip the files in xf_daily_digest.zip (using whatever zip client you have) into a directory on your computer.
Configure
Open up the file xf_daily_digest.php that you just unzipped and edit the circled values below. The instructions are outlined in the file, as well.
2. Upload (FTP) to Your Server
Next, move the files into your web root using an FTP client (I like Filezilla).
Simply locate the web root (either called "public_html" or "www") and drag-and-drop the "pear" folder and "xf_daily_digest.php" file from your local computer into that directory (they should show in the same directory as "upload", "styles", etc.)
3. Cron Job
Creating a cron job can be scary your first time. But it's easier than you may think! And it's necessary to do this so the script will run automatically every day.
A. cPanel Cron Setup (Novice)
If you're a novice with Linux, and you have a cPanel website admin from your web host (very common with LAMP hosts), find this section on your cPanel:
Click the "Cron Jobs" icon, and that'll take you to the form below.
Set the script to run at 0 4 * * * (see below), and enter the script name preceeded by "php" and a space (this tells the cron job to execute the php script).
The full "Command" text should be"
Code:
php /home/YOUR_USERNAME/www/xf_daily_digest.php
B. Manual Cron Setup (Expert)
If you are an experienced Linux admin, and you have shell access (or if you're on a dedicated server or VPS without cPanel), you can instead simply edit your crontab and add this line:
$ nano /etc/crontab
Code:
0 0 * * * root php /home/YOUR_HOME_FOLDER/www/daily_digest.php
Save the file, quit, and restart the cron daemon:
$ /etc/init.d/cron restart
Done!
And that's it! Once you've done these 3 simple steps, the script should run every night!
Cheers.