GRIS_MAIL
in package
Class for sending e mails
With this class mails can be send to a receiver
PHP version 8
Copyright (c) 2022, Holger Heuser, GESIS Leibniz Institute for the Social Sciences Unter Sachsenhausen 6-8 50667 Cologne, Germany
Tags
Table of Contents
- dbtable = 'gris_user'
- The constant for the database table where the settings are stored
- settings_group = "mail"
- The constant for the settings group
- $classname : object
- The name of the class
- $dbconnection : object
- The database object for managing the connection
- $i18n : object
- The object for translations
- $mail_prefix : string
- The individual prefix for outgoing mails
- $sender : string
- The mail address of the sender
- $sendmail : bool
- The variable for sending mails or not (according to settings)
- $settings : object
- The object for settings
- $state : object
- The object for logs
- __construct() : mixed
- The class constructor
- get_mail_address() : string
- Get the mail address from gris_user table by the person ID
- send_mail() : void
- Undocumented function
Constants
dbtable
The constant for the database table where the settings are stored
public
mixed
dbtable
= 'gris_user'
settings_group
The constant for the settings group
public
mixed
settings_group
= "mail"
Properties
$classname
The name of the class
protected
object
$classname
= NULL
Tags
$dbconnection
The database object for managing the connection
private
object
$dbconnection
= null
Tags
$i18n
The object for translations
private
object
$i18n
Tags
$mail_prefix
The individual prefix for outgoing mails
private
string
$mail_prefix
Tags
$sender
The mail address of the sender
private
string
$sender
Tags
$sendmail
The variable for sending mails or not (according to settings)
private
bool
$sendmail
Tags
$settings
The object for settings
private
object
$settings
= null
Tags
$state
The object for logs
private
object
$state
Tags
Methods
__construct()
The class constructor
public
__construct(int $person_id) : mixed
Parameters
- $person_id : int
-
The person_id of the sender
Initializes the login state and checks wether the user is already logged in
Return values
mixed —get_mail_address()
Get the mail address from gris_user table by the person ID
public
get_mail_address(int $person_id) : string
Parameters
- $person_id : int
-
The person ID
Return values
string —Returns the mail adress or NULL if not found
send_mail()
Undocumented function
public
send_mail(int $person_id, string $subject, string $content) : void
Parameters
- $person_id : int
-
The person_id of the receiver
- $subject : string
-
The subject of the mail
- $content : string
-
The message