Umfragen
email Class Reference

Public Member Functions

 __construct ()
 loads the config
 addAddress ($address, $name)
 adds an address to the send stack
 setSubject ($text)
 sets the subject of the mail
 setMessage ($text)
 sets the message of the mail
 email ($au, $subject, $message, $to=array("all"))
 perpares the email and send it
 email_users ($to, $to_name, $subject, $message)
 perpares an email to a user and sends it
 display_email_edit ($poll, $au, $subject='', $message='')
 displays the email composing form. needs a valid <form> html tag before and after
 handle_email_edit ($poll, $au)
 handles the form input and sends the email

Private Member Functions

 load_config ()
 loads the config and throws exceptions used by constructor

Exceptions
Exception"Fehlconfiguration"

 sendmail ()
 actually send the email acording to the internal config.

Private Attributes

 $method = ''
 the method of sending emails. Actually only "groups", which means there is one email-address per group
 $authSecure = ''
 "ssl", the encryption method
 $mailer = ''
 "smtp", the email sender programm. smtp means there is an external smtp server.
 $message = ''
 the message of the email, needs to be not empty
 $addressList = array()
 the address list we are sending to. array of array where index0 is the address and index1 the name, needs to be not empty
 $subject = ''
 the subject of the email, needs to be not empty

Detailed Description

Definition at line 28 of file email.class.php.

Constructor & Destructor Documentation

__construct ( )

loads the config

See Also
load_config()

Definition at line 42 of file email.class.php.

Member Function Documentation

addAddress (   $address,
  $name 
)

adds an address to the send stack

Parameters
string$addressa valid email-address
string$namethe name of the address owner

Definition at line 101 of file email.class.php.

display_email_edit (   $poll,
  $au,
  $subject = '',
  $message = '' 
)

displays the email composing form. needs a valid <form> html tag before and after

Parameters
poll$pollpoll object
auth$au(LSAP OR MYSQL authentification object)
string$subjectthe subject of the message
string$messagethe Text of the message

Definition at line 296 of file email.class.php.

email (   $au,
  $subject,
  $message,
  $to = array("all") 
)

perpares the email and send it

Parameters
auth$au(LSAP OR MYSQL authentification object)
string$subjectthe email's subject
string$messagethe email's message
array$to,alist of groupIDs, the keyword "all" means the email is send to all teacher groups
Returns
NULL when the metod is not valid, string with error message or true on success
Exceptions
Exception

Definition at line 213 of file email.class.php.

email_users (   $to,
  $to_name,
  $subject,
  $message 
)

perpares an email to a user and sends it

Parameters
string$toemail adress we want send to
string$to_namethe name belonging to the address
string$messagethe email's message
Returns
string with error message or true on success
Exceptions
Exception

Definition at line 265 of file email.class.php.

handle_email_edit (   $poll,
  $au 
)

handles the form input and sends the email

Parameters
polls$pollthe poll object
auth$au(LSAP OR MYSQL authentification object)
Returns
bool true on success, else string with errormessage

Definition at line 351 of file email.class.php.

load_config ( )
private

loads the config and throws exceptions used by constructor

Exceptions
Exception"Fehlconfiguration"

Definition at line 51 of file email.class.php.

sendmail ( )
private

actually send the email acording to the internal config.

Returns
bool true on success, else string with errormessage
Exceptions
Exceptionon empty message, subject and address list

Definition at line 143 of file email.class.php.

setMessage (   $text)

sets the message of the mail

Parameters
string$textthe message
Returns
bool true on success, else false

Definition at line 128 of file email.class.php.

setSubject (   $text)

sets the subject of the mail

Parameters
string$textthe subject message
Returns
bool true on success, else false

Definition at line 113 of file email.class.php.

Field Documentation

$addressList = array()
private

the address list we are sending to. array of array where index0 is the address and index1 the name, needs to be not empty

Definition at line 34 of file email.class.php.

$authSecure = ''
private

"ssl", the encryption method

Definition at line 30 of file email.class.php.

$mailer = ''
private

"smtp", the email sender programm. smtp means there is an external smtp server.

Definition at line 31 of file email.class.php.

$message = ''
private

the message of the email, needs to be not empty

Definition at line 33 of file email.class.php.

$method = ''
private

the method of sending emails. Actually only "groups", which means there is one email-address per group

Definition at line 29 of file email.class.php.

$subject = ''
private

the subject of the email, needs to be not empty

Definition at line 35 of file email.class.php.


The documentation for this class was generated from the following file: