PHPDoctor


Radria\Radria_Emailer
class/Radria_Emailer.class.php at line 20

Class Radria_Emailer

Zend_Mail
└─Radria_Emailer

public class Radria_Emailer
extends Zend_Mail

Radria_Emailer Class Used to Send Emails using email templates with merge capabilities.

Its compatible with the older Emailer.class.php but its based on the Zend_Mail http://framework.zend.com

Author:
Philippe Lewicki
Version:
2.0.3

Field Summary
mixed

$cfgEmailField

mixed

$cfgTemplateTable

mixed

$file

mixed

$filename

mixed

$has_html

mixed

$header

mixed

$mBody

mixed

$mBodyHtml

mixed

$mSenderEmail

mixed

$mSenderName

mixed

$mSubject

mixed

$sql_order

mixed

$sql_query

Method Summary
void

appendBody(mixed str)

void

appendBodyHtml(mixed str)

void

attachFile(mixed file, mixed filename, sqlConnect conx, string templatename)

Set a file to be attach to the email message.

void

cleanup()

cleanup Cleanup a message so an other message can be sent.

void

eventSendTemplateEmail(EventControler eventcontroler, email string, email_template name, fields array)

eventSendTemplateEmail eventaction that uses a template to send an email.

void

fusion(sqlConnect query)

Merge and send an email message with the content of an executed sqlQuery .

void

getBody()

Array

getField(String template)

Load the field in the field attribute from the HTML template.

void

getNumberOfEmailSent()

void

getTemplateBodyHtml()

void

getTemplateBodyText()

void

getTemplateSubject()

void

hasHtml(mixed bool)

void

loadEmailer(mixed conx, mixed templatename)

void

mergeArray(mixed fields_values, $fields_values Array)

mergeArray() Merge an Array with a currently loaded email template

void

prependBody(mixed str)

void

prependBodyHtml(mixed str)

void

sendMailHtml(string email, string subject, string body, string bodyhtml, string headini)

Send an email with a text and html version

void

sendMailJoin(string email, string subject, string body, string file, string filename, string headini)

Send an email with a file attach

void

sendMailStandard(string email, string subject, string body, string header)

Send a standard text email

void

sendMergeArray(mixed fields_values, str email, array field_value)

sendMergeArray() if the email parameter is not set the array parameter requires an email key with the email to send the message to.

void

sendMergeQuery(sqlQuery query, $query an)

mergeQuery() Does the same as fusion() but using the new naming convention for consistancy with mergetArray(); Its a more elegant got but with a small performance hit.

void

setBody(mixed bodytxt)

setBody Deprecate use setBodyText() instead.

void

setEmailTemplate(string templatename, mixed conx, mix sqlConnect)

setEmailTemplate load an instance of an email message to be sent or merged Loading the template directly from the database should not be used anymore, its keeped for compatiblity reason.

bool

setHeader()

Set the Header it create the header of the message if the sender is set.

void

setSender(string name, string email)

Set the sender of the email message This is deprecate use setFrom() instead.

void

setTemplateBodyHtml(mixed bodyhtml)

void

setTemplateBodyText(mixed body)

void

setTemplateSubject(mixed subject)

string

stringFusion(mixed thestring, array values, string with)

The secret sauce.

void

validateEmail(string email)

Check if the email as an existing domain name.

Field Detail

class/Radria_Emailer.class.php at line 23

cfgEmailField

public mixed $cfgEmailField = "email"

class/Radria_Emailer.class.php at line 24

cfgTemplateTable

public mixed $cfgTemplateTable = "emailtemplate"

class/Radria_Emailer.class.php at line 31

file

public mixed $file

class/Radria_Emailer.class.php at line 32

filename

public mixed $filename

class/Radria_Emailer.class.php at line 33

has_html

public mixed $has_html = false

class/Radria_Emailer.class.php at line 25 public mixed $header

class/Radria_Emailer.class.php at line 26

mBody

public mixed $mBody

class/Radria_Emailer.class.php at line 27

mBodyHtml

public mixed $mBodyHtml

class/Radria_Emailer.class.php at line 29

mSenderEmail

public mixed $mSenderEmail

class/Radria_Emailer.class.php at line 30

mSenderName

public mixed $mSenderName

class/Radria_Emailer.class.php at line 28

mSubject

public mixed $mSubject

class/Radria_Emailer.class.php at line 22

sql_order

public mixed $sql_order

class/Radria_Emailer.class.php at line 21

sql_query

public mixed $sql_query

Method Detail

class/Radria_Emailer.class.php at line 437

appendBody

public void appendBody(mixed str)

class/Radria_Emailer.class.php at line 441

appendBodyHtml

public void appendBodyHtml(mixed str)

class/Radria_Emailer.class.php at line 84

attachFile

public void attachFile(mixed file, mixed filename, sqlConnect conx, string templatename)

Set a file to be attach to the email message.

Parameters:
conx - connexion to the database thrue an sqlConnect object
templatename - name of the template to load

class/Radria_Emailer.class.php at line 224

cleanup

public void cleanup()

cleanup Cleanup a message so an other message can be sent.


class/Radria_Emailer.class.php at line 240

eventSendTemplateEmail

public void eventSendTemplateEmail(EventControler eventcontroler, email string, email_template name, fields array)

eventSendTemplateEmail eventaction that uses a template to send an email. requires template name, email to send to and optional array of data to merge.

Parameters:
string - with email addrss
name - of the template to load
array - for fields with value to merge with the email template.

class/Radria_Emailer.class.php at line 129

fusion

public void fusion(sqlConnect query)

Merge and send an email message with the content of an executed sqlQuery . This one is deprecate, use the sendMergeQuery() instead.

Parameters:
query - executed sqlQuery
Deprecated.
See Also:
getField()

class/Radria_Emailer.class.php at line 452

getBody

public void getBody()

class/Radria_Emailer.class.php at line 292

getField

public Array getField(String template)

Load the field in the field attribute from the HTML template. get Table Field could be used instead but it will not get the extra fields and multiple tables fields

Parameters:
template - HTML template (row, header, footer) where there is fields to be used
Returns:
$fields indexed on the field name.

class/Radria_Emailer.class.php at line 258

getNumberOfEmailSent

public void getNumberOfEmailSent()

class/Radria_Emailer.class.php at line 274

getTemplateBodyHtml

public void getTemplateBodyHtml()

class/Radria_Emailer.class.php at line 271

getTemplateBodyText

public void getTemplateBodyText()

class/Radria_Emailer.class.php at line 277

getTemplateSubject

public void getTemplateSubject()

class/Radria_Emailer.class.php at line 455

hasHtml

public void hasHtml(mixed bool)

class/Radria_Emailer.class.php at line 75

loadEmailer

public void loadEmailer(mixed conx, mixed templatename)

class/Radria_Emailer.class.php at line 191

mergeArray

public void mergeArray(mixed fields_values, $fields_values Array)

mergeArray() Merge an Array with a currently loaded email template

Parameters:
Array - of fields in format $fields['fieldname']=value;

class/Radria_Emailer.class.php at line 429

prependBody

public void prependBody(mixed str)

class/Radria_Emailer.class.php at line 433

prependBodyHtml

public void prependBodyHtml(mixed str)

class/Radria_Emailer.class.php at line 406

sendMailHtml

public void sendMailHtml(string email, string subject, string body, string bodyhtml, string headini)

Send an email with a text and html version


class/Radria_Emailer.class.php at line 343

sendMailJoin

public void sendMailJoin(string email, string subject, string body, string file, string filename, string headini)

Send an email with a file attach


class/Radria_Emailer.class.php at line 379

sendMailStandard

public void sendMailStandard(string email, string subject, string body, string header)

Send a standard text email


class/Radria_Emailer.class.php at line 207

sendMergeArray

public void sendMergeArray(mixed fields_values, str email, array field_value)

sendMergeArray() if the email parameter is not set the array parameter requires an email key with the email to send the message to.


class/Radria_Emailer.class.php at line 170

sendMergeQuery

public void sendMergeQuery(sqlQuery query, $query an)

mergeQuery() Does the same as fusion() but using the new naming convention for consistancy with mergetArray(); Its a more elegant got but with a small performance hit. fusion() is just keeped for high performance needs.

Parameters:
an - sqlQuery object
See Also:
mergeArray()

class/Radria_Emailer.class.php at line 449

setBody

public void setBody(mixed bodytxt)

setBody Deprecate use setBodyText() instead.


class/Radria_Emailer.class.php at line 44

setEmailTemplate

public void setEmailTemplate(string templatename, mixed conx, mix sqlConnect)

setEmailTemplate load an instance of an email message to be sent or merged Loading the template directly from the database should not be used anymore, its keeped for compatiblity reason.

Usage:
$emailier->setEmailTempalte(new EmailTemplate("email_template_name"));
Parameters:
sqlConnect - $conx connexion to the database thrue an sqlConnect object or an EmailTemplate object.
templatename - name of the template to load

class/Radria_Emailer.class.php at line 110

setHeader

public bool setHeader()

Set the Header it create the header of the message if the sender is set.

Returns:
true if the sender was set and header set correctly

class/Radria_Emailer.class.php at line 101

setSender

public void setSender(string name, string email)

Set the sender of the email message This is deprecate use setFrom() instead.

Parameters:
name - name of the sender
email - email of the sender
Deprecate.
See Also:
setFrom()

class/Radria_Emailer.class.php at line 265

setTemplateBodyHtml

public void setTemplateBodyHtml(mixed bodyhtml)

class/Radria_Emailer.class.php at line 262

setTemplateBodyText

public void setTemplateBodyText(mixed body)

class/Radria_Emailer.class.php at line 268

setTemplateSubject

public void setTemplateSubject(mixed subject)

class/Radria_Emailer.class.php at line 308

stringFusion

public string stringFusion(mixed thestring, array values, string with)

The secret sauce. Take a string, extract the fields in [] and replace the fields in [] with their respective values from the $values array.

Parameters:
with - fields to merge in []
values - array with format $values[field_name] = $value
Returns:
merged

class/Radria_Emailer.class.php at line 322

validateEmail

public void validateEmail(string email)

Check if the email as an existing domain name.

Parameters:
email - email to check

PHPDoctor