Autonews
========

Infusion for phpFusion v 7, Autonews v 1.0


Purpose:
-------

To provide a tool to send automatically mails to subscribing users
containing information about changes on your site.

In the admin setup you decide how frequent the mail should be (ie daily or weekly),
and you specify which parts of your site to include. Nearly all parts of phpfusion
are covered (news, articles, photoalbums, photos, forum threads, forum posts,
downloads, weblinks, comments, new users, shoutbox).

Your users are subscribing to the mail by checking the autonews user field,
which is a part of the infusion. If they dont like your mails, the mail contains
an unsubscribe link.

Mails are send automatically, and you do not need to set up a cronjob or similar
service. Admins can monitor the status (number of subscribers, time for last mail
sending, etc.) in a side panel.

Admin settings are provided to avoid overloading of your site or your mailserver. 
You can specify a chunk size so that mail sending do not get too large and you can
specify a waiting time between two mail sendings.

You can give your mails a personal touch by adding graphics to it. Obviously the 
language of your mails obey the language of your site (provided that a locale
file for your language is available).


Installation:
-------------

1. Install the infusion

	a. Download autonews_infusion.zip
	b. Copy with your FTP-program the entire content of the files directory from 
	   autonews_infusion.zip to your phpfusion main folder
	c. Under Administration - Infusions: Install the infusion
	d. Under Administration - Users - Users Fields: Activate the autonews field
	e. Under Administration - System - Elements: Install autonews_panel.php as
	   an element and activate it

2. Use the infusion
	a. The infusion has an admin panel and a status site panel. Both are shown only
     to users having admin right in autonews
  b. The status panel provides information regarding sending mails. The admin
     panel is used to change settings
  c. After installation the infusion is disabled. Until you have changed this in
     the autonews admin panel, no mails will be send
  d. Mails are only send to subsribing users, ie users who has checked autonews
     in their profile (a user-defined field)

Admin:
------

In the admin panel you can change the settings of autonews. The following comments
apply:

  Frequency: You can specify the time between mail sendings, but you cannot specify
  time
  At least xxx news: If there are too few news the mail is nots end. Next time
  mails are send, it will look at the entire period since last sending, meaning
  that news will accumulate, until you reach the lower limit
  Maximum xxx news: If there are too many news, a summary line is created regarding
  the lines that are left out. The soring goes by date, so its the oldest news that
  are summarized and left out in the details
  Send to max xxx persons at a time:
  Pause for at least xxx minutes between mails:
  These features have been incorporated to avoid overload and/or timeout if you
  have many subscribers or your mail server is slow or heavy loaded

In the admin panel you have the following options:

  Test present mail: Use this to see the effect of changed settings. It shows the
  mail that would have be send at the time of clicking, if sending was due. It also
  shows the receivers of the mail
  Show previous mail: Use this to see the most recent send mail. The list of 
  receivers reflects the present settings, therefore not necessarily the subscribers
  at the time of sending the mail
  Unsubscribe all: Deletes all subscribers 


Background:
-----------

It is the side element that handles generation and sending of the mail. To usual
users it is not visible, but every time a page with the element is generated, it
checks whether mails should be send, and does so if appropriate.

Therefore, if your page is seldomly used, autonews cannot guarantee, that mails
are send in due course.

Effort has been put into minimizing the load represented by the autonews panel.
Only one query is done to see if sending is due, and only if this is the case
the mail is generated. Mail sending can be divided into chunks. Even when mail 
sending is divided into chunks, the generation of the mail (which obviously takes
the most queries) is only done once. 


Modifications:
--------------

Those parameters of autonews, that cannot be adjusted in the admins panel,
but which have relevance, are placed in the autonews_params.php file:
  fromemail: Override the value of settings['siteemail'] as the sender of emails
  copyemail: Specify an email adress to receive a visible copy of all mails send
  hsgallery: Set to TRUE to invoke support of hsgallery
  cronjob:   Set to true to use cronjob to send emails rather than the panel.
             Follow the instructions in infusions/autonews/autonews_cronjob.php

The date formats used are defined in locale.php (AN010 and AN011) for easy 
adjustment.


Changelog:
----------

Ver Date    Changes
1.0	091129	First version
