If you configure a cron job to run periodically or enable Poor Man's Cron so that cron jobs are executed upon every manual page visit, massmailer queued messages (administer >> mass mailer >> manage messages >> create new message >> Queue message) should be sent based on the date and time specified by the user before queuing the message. Massmailer is not sending out any queued messages, however, unless you manually access Send Messages (admininster >> mass mailer >> send messages) or enable cron queue processing from massmailer admin settings (administer >> settings >>massmailer)
Initial Conditions
1. Massmailer and poormanscron modules must be enabled in: http://civicrm.civicspacelabs.com/home/admin/modules
2. Access Poormanscron settings: http://civicrm.civicspacelabs.com/home/admin/settings/poormanscron
3. In Time Intervals, set "Cron runs interval" to 1 and Save Configuration.
<>
1. Massmailer module must be enabled in: http://civicrm.civicspacelabs.com/home/admin/modules
2. Create a cron job using "crontab -e" in a UNIX terminal window.
3. Configure the cron job to run every 5 minutes.
Steps
1. Configure massmailer settings: http://civicrm.civicspacelabs.com/home/admin/settings/massmailer
2. In General Options, set "Time notation preference:" to 24h
3. In Mail Engine Options, uncheck "cron queue processing".
4. Save Configuration.
5. Create a Mailing List: http://civicrm.civicspacelabs.com/home/admin/massmailer
6. Manage the Mailing List: http://civicrm.civicspacelabs.com/home/admin/massmailer/list/manage/#
7. Assign Current Subscribers, Add them manually by entering e-mail addresses or Subscribe a CiviCRM Group.
8. Add Subscribers.
9. Verify an e-mail address of a subscriber in the Subscribers section and make sure you can access this account. (If you can't,
add a subscriber or an e-mail where you can verify the sent message)
10.Compose a message for the list: http://civicrm.civicspacelabs.com/home/admin/massmailer/message/send
11.For List Assignments, check the list created in Step #5.
12.Set the Send date to: Current Month, Today's Date, Current Year, Current Hour, 1 min in the future
13.Queue Message
14.Wait a specified amount of time for the cron job to run or click any page to activate the cron job if you have enabled poormanscron:
-- If you have enabled poormanscron wait 3 minutes (1 min for PMC interval + 1 min for send date + 1 min buffer) for
the message to be sent.
-- If you set your cron job to run every 5, 10, etc.. minutes wait that amount of time + 2 min.
15.View message status: http://civicrm.civicspacelabs.com/home/admin/massmailer/message
Results
16.The message will show that it has only been (submitted), but not (sent)
Notes
1. This defect is a duplicate of http://drupal.org/node/29591 (CiviCRM: Auto-Send Mesasge from Message Queue fails)
At that time we suspected the defect was by-design, because cron was not enabled and configured. Let's use this
current defect since it is more descriptive.
2. If this does not work, I recommend to just remove the Send date feature for the 0.8.2 release of CivicSpace. I can submit a
feature request later to have it added back.
3. When the cron job tells massmailer to execute the queued message action:
a. Massmailer should wait until the current date and time matches the send date and time of the message to send the message
b. Massmailer should send the message early if the current date and time are in close proximity of the send date and time of the
message (let's say 5 minutes or less.. If the cron job is configured to run every 5 minutes and the window is missed, the
message may be sent 5 minutes late)
c. Massmailer should always send the message if the current date and time exceed the send date and time. (In this case the
window of time may have been missed depending on how long the system admin configured the cron jobs to run)
Tests
Here were various tests I ran for this and their results at 9/6 18:50
--#1: Message to be sent at 18:17--
1. Time message is queued: 9/6, 18:08
2. Time until next cron run: 9/6, 18:13 (at least) (cron runs every 5 min)
3. Message send time: 18:17
4. Actual Message send time: Never Sent (33 min late)
--#2: Message to be sent at 18:20--
1. Time message is queued: 9/6, 18:12
2. Time until next cron run: 9/6, 18:17 (at least) (cron runs every 5 min)
3. Message send time: 18:29
4. Actual Message send time: Never Sent (30 min late)
--#3: Message to be sent at 18:25--
1. Time message is queued: 9/6, 18:14
2. Time until next cron run: 9/6, 18:19 (at least) (cron runs every 5 min)
3. Message send time: 18:25
4. Actual Message send time: Never Sent (25 min late)
--#4: Message to be sent at 18:34 (Verifying if mesage can be sent within 2 min of processing)--
1. Time message is queued: 9/6, 18:32
2. Time until next cron run: 9/6, 18:37 (at least) (cron runs every 5 min)
3. Message send time: 18:34
4. Actual Message send time: Never Sent (16 min late)
--#5: Message to be sent at 18:36 (Verifying if message can be sent within 1 min of processing)--
1. Time message is queued: 9/6, 18:35
2. Time until next cron run: 9/6, 18:40 (at least) (cron runs every 5 min)
3. Message send time: 18:36
4. Actual Message send time: Never Sent (14 min late)
--#6: Message to be sent at 18:38 (Veriyfing if message can be sent at same time as when processed)--
1. Time message is queued: 9/6, 18:38
2. Time until next cron run: 9/6, 18:43 (at least) (cron runs every 5 min)
3. Message send time: 18:38
4. Actual Message send time: Never Sent (12 min late)
--#7: Message to be sent at 18:41 (Verifying if message can be sent when send time is 1 min in the past)--
1. Time message is queued: 9/6, 18:42
2. Time until next cron run: 9/6, 18:47 (at least) (cron runs every 5 min)
3. Message send time: 18:41
4. Actual Message send time: Never Sent (8 min late)
Comments
Comment #1
sdemps3 commentedAfter working with Audrey on this defect for quite some time we came to some conclusions:
1. Auto-send functionality for massmailer is non existant. The only way to send messages with massmailer is to use the Send Messages
function accessible from admininster >> mass mailer >> send messages.
2. When queueing a message before sending you have to use a send date time that is the same as the real time of your host server. Not
the time zone setting configured in your admin user profile. (I will submit a feature request about this later) Messages will always be
sent based on the host server's real time.
3. If you queue a message with a send time > than the host server's real time by so many minutes, clicking send messages will not cause
the message to be sent at the time specified. The message will sit in the queue. You have to wait until the host server's real time has
exceeded the send date time and then click send messages again. A defect will be filed about this.
So the functionality I'm looking for in this defect is un related to the way the feature works currently. I will submit a feature request to have
auto-send message functionality implemented later.
Comment #2
sdemps3 commentedI have finally verified that auto-send functionality works fine if you configure all messages to match the host server's time zone.. The functionality for flusing the queue with cron works the same as using the send messages button. Please ignore all of my statements about this function being broken.. I cannot edit this portion of the defect..