Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

Public Member Functions | Static Public Member Functions | Public Attributes | Private Member Functions | List of all members
eZBulkMail Class Reference

## Public Member Functions
| __construct ( $id=-1)
| store ()
| delete ( $id=-1)
| get ( $id=-1)
| id ()
| sender ()
| setSender ( $newSender)
| fromName ()
| from ()
| setFromName ( $newSender)
| subject ( $html=true)
| setSubject ( $newSubject)
| body ( $html=true)
| setBodyText ( $newBody)
| owner ()
| setOwner ( $newOwner)
| date ()
| setDate ( $value)
| isDraft ()
| setIsDraft ( $value)
| addToCategory ( $value)
| categories ( $as_object=true)
| useTemplate ( $templateID)
| template ( $as_object=true)
| send ( $article=false)
| sendDelayedMail ()
| sendSingle ( $addressID, $mailID, $user=false)
| addToDelayList ( $subscripter, $category, $delay)

## Static Public Member Functions
static | getAll ( $draftsOnly=false)

## Public Attributes
| $ID
| $UserID
| $From
| $FromName
| $ReplyTo
| $Subject
| $BodyText
| $SentDate
| $IsDraft
| $IsConnected
| Is true if the object has database connection, false if not. More...

## Private Member Functions
| haveSentHourly ()
| haveSentDaily ()
| haveSentWeekly ()
| haveSentMonthly ()
| setOffset ( $delay)
| addLogEntry ( $mail)
| isSent ( $mail)

## Detailed Description

! eZBulkMail eZBulkMail documentation.

Example code:

Definition at line 45 of file ezbulkmail.php.

## Constructor & Destructor Documentation

## ◆ __construct()

eZBulkMail::__construct | ( |  | $id = `-1` | ) |

Constructor.

Definition at line 50 of file ezbulkmail.php.

References $ID, and $id.

## Member Function Documentation

## ◆ addLogEntry()

eZBulkMail::addLogEntry | ( |  | $mail | ) |
| private

Sets this mail as sent for the address given which is the email address as a text.

Definition at line 824 of file ezbulkmail.php.

References $db, $result, and eZDB\globalDatabase().

Referenced by send().

## ◆ addToCategory()

eZBulkMail::addToCategory | ( |  | $value | ) |

Adds this bulkmail to a category.

Definition at line 341 of file ezbulkmail.php.

References $db, $result, and eZDB\globalDatabase().

## ◆ addToDelayList()

eZBulkMail::addToDelayList | ( |  | $subscripter,
|  |  | $category,
|  |  | $delay
| ) |  |

Sets this mail to the delay list.

Definition at line 848 of file ezbulkmail.php.

References $db, $ID, $result, and eZDB\globalDatabase().

## ◆ body()

eZBulkMail::body | ( |  | $html = `true` | ) |

returns the body.

Definition at line 269 of file ezbulkmail.php.

References $BodyText.

## ◆ categories()

eZBulkMail::categories | ( |  | $as_object = `true` | ) |

Returns the categories a mail is member of. False if none..

Definition at line 382 of file ezbulkmail.php.

References $category_array, $db, and eZDB\globalDatabase().

Referenced by send().

## ◆ date()

eZBulkMail::date | ( |  | ) |

Returns the date that this mail was distributed

Definition at line 306 of file ezbulkmail.php.

References $dateTime.

## ◆ delete()

eZBulkMail::delete | ( |  | $id = `-1` | ) |

Deletes a eZBulkMail object from the database.

Definition at line 122 of file ezbulkmail.php.

References $db, $ID, $id, $result, $results, and eZDB\globalDatabase().

## ◆ from()

eZBulkMail::from | ( |  | ) |

Returns the sender's name.

Definition at line 235 of file ezbulkmail.php.

References $From.

## ◆ fromName()

eZBulkMail::fromName | ( |  | ) |

Returns the sender's name.

Definition at line 227 of file ezbulkmail.php.

References $FromName.

## ◆ get()

eZBulkMail::get | ( |  | $id = `-1` | ) |

Fetches the object information from the database.

Definition at line 148 of file ezbulkmail.php.

References $db, $id, $mail_array, and eZDB\globalDatabase().

## ◆ getAll()

static eZBulkMail::getAll | ( |  | $draftsOnly = `false` | ) |
| static

Returns all the categories found in the database.

The categories are returned as an array of eZBulkMail objects.

Definition at line 179 of file ezbulkmail.php.

References $db, $i, $mail_array, and eZDB\globalDatabase().

## ◆ haveSentDaily()

eZBulkMail::haveSentDaily | ( |  | ) |
| private

Return true if the current timestamp is one day more than the offset

Definition at line 680 of file ezbulkmail.php.

References $db, $now, $offset, and eZDB\globalDatabase().

Referenced by sendDelayedMail().

## ◆ haveSentHourly()

eZBulkMail::haveSentHourly | ( |  | ) |
| private

Return true if the current timestamp is one hour more than the offset

Definition at line 660 of file ezbulkmail.php.

References $db, $now, $offset, and eZDB\globalDatabase().

Referenced by sendDelayedMail().

## ◆ haveSentMonthly()

eZBulkMail::haveSentMonthly | ( |  | ) |
| private

Return true if the current timestamp is one month more than the offset

Definition at line 716 of file ezbulkmail.php.

References $db, $now, $offset, and eZDB\globalDatabase().

Referenced by sendDelayedMail().

## ◆ haveSentWeekly()

eZBulkMail::haveSentWeekly | ( |  | ) |
| private

Return true if the current timestamp is seven days more than the offset

Definition at line 698 of file ezbulkmail.php.

References $db, $now, $offset, and eZDB\globalDatabase().

Referenced by sendDelayedMail().

## ◆ id()

eZBulkMail::id | ( |  | ) |

Returns the object ID to the category. This is the unique ID stored in the database.

Definition at line 203 of file ezbulkmail.php.

References $ID.

## ◆ isDraft()

eZBulkMail::isDraft | ( |  | ) |

Returns true if this mail is a draft.

Definition at line 325 of file ezbulkmail.php.

References $IsDraft.

## ◆ isSent()

eZBulkMail::isSent | ( |  | $mail | ) |
| private

Checks if this mail is sent for the given address.

Definition at line 874 of file ezbulkmail.php.

References $db, $result, and eZDB\globalDatabase().

Referenced by send().

## ◆ owner()

eZBulkMail::owner | ( |  | ) |

Returns the userID of the user that owns this object

Definition at line 287 of file ezbulkmail.php.

References $UserID.

## ◆ send()

eZBulkMail::send | ( |  | $article = `false` | ) |

This function handles sending of the mail. Before sending the mail it merges the associated template (if any) with the body contents. The mail is pulled out of the drafts, and the template is disconnected. TODO: Current implementation sends all the mail in one big bulk. For larger systems we want to spread it out over time.

Definition at line 450 of file ezbulkmail.php.

References $article, $categories, $categoryID, $db, $group, $groups, $i, $mail, $permission, $result, addLogEntry(), categories(), eZDB\globalDatabase(), eZObjectPermission\hasPermissionWithDefinition(), eZArticle\isAuthor(), isSent(), store(), and useTemplate().

## ◆ sendDelayedMail()

eZBulkMail::sendDelayedMail | ( |  | ) |

Definition at line 577 of file ezbulkmail.php.

References $categoryID, $db, $i, $result, $user_array, eZDB\globalDatabase(), haveSentDaily(), haveSentHourly(), haveSentMonthly(), haveSentWeekly(), sendSingle(), and setOffset().

## ◆ sender()

eZBulkMail::sender | ( |  | ) |

Returns the sender address.

Definition at line 211 of file ezbulkmail.php.

References $From.

## ◆ sendSingle()

eZBulkMail::sendSingle | ( |  | $addressID,
|  |  | $mailID,
|  |  | $user = `false`
| ) |  |

Definition at line 732 of file ezbulkmail.php.

References $db, $id, $mail, $result, $user, and eZDB\globalDatabase().

Referenced by sendDelayedMail().

## ◆ setBodyText()

eZBulkMail::setBodyText | ( |  | $newBody | ) |

Sets the body.

Definition at line 279 of file ezbulkmail.php.

## ◆ setDate()

eZBulkMail::setDate | ( |  | $value | ) |

Sets the date when this mail was sent.

Definition at line 317 of file ezbulkmail.php.

## ◆ setFromName()

eZBulkMail::setFromName | ( |  | $newSender | ) |

Sets the sender's name.

Definition at line 243 of file ezbulkmail.php.

## ◆ setIsDraft()

eZBulkMail::setIsDraft | ( |  | $value | ) |

Set if this mail is a draft or not.

Definition at line 333 of file ezbulkmail.php.

## ◆ setOffset()

eZBulkMail::setOffset | ( |  | $delay | ) |
| private

Sets the offset to the current time.

Definition at line 784 of file ezbulkmail.php.

References $checkArray, $db, $result, and eZDB\globalDatabase().

Referenced by sendDelayedMail().

## ◆ setOwner()

eZBulkMail::setOwner | ( |  | $newOwner | ) |

Sets the owner of this mail

Definition at line 295 of file ezbulkmail.php.

## ◆ setSender()

eZBulkMail::setSender | ( |  | $newSender | ) |

Sets the sender address.

Definition at line 219 of file ezbulkmail.php.

## ◆ setSubject()

eZBulkMail::setSubject | ( |  | $newSubject | ) |

Sets the subject of the mail.

Definition at line 261 of file ezbulkmail.php.

## ◆ store()

eZBulkMail::store | ( |  | ) |

Stores a eZBulkMail object to the database.

Definition at line 66 of file ezbulkmail.php.

References $db, $result, and eZDB\globalDatabase().

Referenced by send().

## ◆ subject()

eZBulkMail::subject | ( |  | $html = `true` | ) |

Returns the subject.

Definition at line 251 of file ezbulkmail.php.

References $Subject.

## ◆ template()

eZBulkMail::template | ( |  | $as_object = `true` | ) |

Returns the template associated with this mail or false if none.

Definition at line 430 of file ezbulkmail.php.

References $db, $template_array, and eZDB\globalDatabase().

## ◆ useTemplate()

eZBulkMail::useTemplate | ( |  | $templateID | ) |

Associates a template with a bulkmail. If the parameter is false, the mail is dissassociated with all templates. NOTE: A bulkmail is only associated with a template before it is sent. After it is sent the template is stored in the mail. This is because templates may change, but you want to know exactly what you have sent to your customers.

Definition at line 403 of file ezbulkmail.php.

References $db, $result, $templateID, and eZDB\globalDatabase().

Referenced by send().

## Member Data Documentation

## ◆ $BodyText

eZBulkMail::$BodyText

Definition at line 890 of file ezbulkmail.php.

Referenced by body().

## ◆ $From

eZBulkMail::$From

Definition at line 886 of file ezbulkmail.php.

Referenced by from(), and sender().

## ◆ $FromName

eZBulkMail::$FromName

Definition at line 887 of file ezbulkmail.php.

Referenced by fromName().

## ◆ $ID

eZBulkMail::$ID

Definition at line 884 of file ezbulkmail.php.

Referenced by __construct(), addToDelayList(), delete(), and id().

## ◆ $IsConnected

eZBulkMail::$IsConnected

Is true if the object has database connection, false if not.

Definition at line 895 of file ezbulkmail.php.

## ◆ $IsDraft

eZBulkMail::$IsDraft

Definition at line 892 of file ezbulkmail.php.

Referenced by isDraft().

## ◆ $ReplyTo

eZBulkMail::$ReplyTo

Definition at line 888 of file ezbulkmail.php.

## ◆ $SentDate

eZBulkMail::$SentDate

Definition at line 891 of file ezbulkmail.php.

## ◆ $Subject

eZBulkMail::$Subject

Definition at line 889 of file ezbulkmail.php.

Referenced by subject().

## ◆ $UserID

eZBulkMail::$UserID

Definition at line 885 of file ezbulkmail.php.

Referenced by owner().

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

- ezbulkmail.php

Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.