Galette API documentation
Gestionnaire d’Adhérents en Ligne Extrêmement Tarabiscoté mais Tellement Efficace
1.0.0
Galette\Core\Mailing Class Reference
Inheritance diagram for Galette\Core\Mailing:
Collaboration diagram for Galette\Core\Mailing:

Public Member Functions

 __construct (Preferences $preferences, array $members=[], int $id=null)
 
 loadFromHistory (ArrayObject $rs, bool $new=true)
 
 send ()
 
 setRecipients (array $members)
 
 store (array $files)
 
 moveAttachments (int $id)
 
 removeAttachment (string $name)
 
 removeAttachments (bool $temp=false)
 
 getAttachmentErrorMessage (int $code)
 
 existsInHistory ()
 
 __get (string $name)
 
 __isset (string $name)
 
 __set (string $name, mixed $value)
 
- Public Member Functions inherited from Galette\Core\GaletteMail
 __construct (Preferences $preferences)
 
 isHTML (bool $set=null)
 
 getSenderName ()
 
 getSenderAddress ()
 
 getSubject ()
 
 getErrors ()
 
 getMessage ()
 
 getWrappedMessage ()
 
 setSubject (string $subject)
 
 setMessage (string $message)
 
 setSender (string $name, string $address)
 
 setTimeout (int $timeout)
 

Public Attributes

const STEP_START = 0
 
const STEP_PREVIEW = 1
 
const STEP_SEND = 2
 
const STEP_SENT = 3
 
const MIME_HTML = 'text/html'
 
const MIME_TEXT = 'text/plain'
 
const MIME_DEFAULT = self::MIME_TEXT
 
- Public Attributes inherited from Galette\Core\GaletteMail
const MAIL_ERROR = 0
 
const MAIL_SENT = 1
 
const METHOD_DISABLED = 0
 
const METHOD_PHPMAIL = 1
 
const METHOD_SMTP = 2
 
const METHOD_QMAIL = 3
 
const METHOD_GMAIL = 4
 
const METHOD_SENDMAIL = 5
 
const SENDER_PREFS = 0
 
const SENDER_CURRENT = 1
 
const SENDER_OTHER = 2
 

Additional Inherited Members

- Static Public Member Functions inherited from Galette\Core\GaletteMail
static isValidEmail (string $address)
 
static isUrl (string $url)
 
- Protected Member Functions inherited from Galette\Core\GaletteMail
 cleanedHtml ()
 
 getPhpMailer ()
 
- Protected Attributes inherited from Galette\Core\GaletteMail
array $attachments = array()
 

Constructor & Destructor Documentation

◆ __construct()

Galette\Core\Mailing::__construct ( Preferences  $preferences,
array  $members = [],
int  $id = null 
)

Default constructor

Parameters
Preferences$preferencesPreferences instance
array<int,Adherent>$members An array of members
?integer$id Identifier, defaults to null

TODO: add a preference that propose default mime-type to use, then init it here

Member Function Documentation

◆ __get()

Galette\Core\Mailing::__get ( string  $name)

Global getter method

Parameters
string$namename of the property we want to retrieve
Returns
mixed the called property

◆ __isset()

Galette\Core\Mailing::__isset ( string  $name)

Global isset method Required for twig to access properties via __get

Parameters
string$namename of the property we want to retrieve
Returns
bool

◆ __set()

Galette\Core\Mailing::__set ( string  $name,
mixed  $value 
)

Global setter method

Parameters
string$namename of the property we want to assign a value to
mixed$valuea relevant value for the property
Returns
void

◆ existsInHistory()

Galette\Core\Mailing::existsInHistory ( )

Does mailing already exists in history?

Returns
boolean

◆ getAttachmentErrorMessage()

Galette\Core\Mailing::getAttachmentErrorMessage ( int  $code)

Return textual error message

Parameters
int$codeThe error code
Returns
string Localized message

◆ loadFromHistory()

Galette\Core\Mailing::loadFromHistory ( ArrayObject  $rs,
bool  $new = true 
)

Loads a mailing from history

Parameters
ArrayObject<string,mixed>$rs Mailing entry
boolean$newTrue if we create a 'new' mailing, false otherwise (from preview for example)
Returns
boolean

◆ moveAttachments()

Galette\Core\Mailing::moveAttachments ( int  $id)

Move attachments with final id once mailing has been stored

Parameters
int$idMailing history id
Returns
void

◆ removeAttachment()

Galette\Core\Mailing::removeAttachment ( string  $name)

Remove specified attachment

Parameters
string$nameFilename
Returns
void

◆ removeAttachments()

Galette\Core\Mailing::removeAttachments ( bool  $temp = false)

Remove mailing attachments

Parameters
boolean$tempRemove only temporary attachments, to avoid history breaking
Returns
boolean

◆ send()

Galette\Core\Mailing::send ( )

Apply final header to email and send it :-)

Returns
int

Reimplemented from Galette\Core\GaletteMail.

◆ setRecipients()

Galette\Core\Mailing::setRecipients ( array  $members)

Set mailing recipients

@phpstan-ignore-next-line

Parameters
array<int,Adherent>$members Array of Adherent objects
Returns
bool

Reimplemented from Galette\Core\GaletteMail.

◆ store()

Galette\Core\Mailing::store ( array  $files)

Store maling attachments

Parameters
array<string,string|int>$files Array of uploaded files to store
Returns
true|int error code

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