Xataface Email Module
0.3.2
Email/Mailmerge Module for Xataface
|
A false interface used to document that methods that can be implemented in the application delegate class to affect the functioning of the Email module. More...
Public Member Functions | |
decorateEmailContext (Dataface_Record $email, Dataface_Record $template, Dataface_Record $recipient) | |
A hook that is called just before an email is sent. This gives you an opportunity to add or modify data that is being sent. | |
getEmailOptOutMessage (Dataface_Record $recipient, $url) | |
A hook that can optionally override the "opt-out" message that is added at the end of an email. | |
Email__isBlackListed ($email) | |
Checks whether a particular Email address is blacklisted. This will complement or supplement the existing blacklist table check depending on the return value of this method. | |
Email__afterOptIn ($email) | |
Trigger fired after an email address opts into the email list. | |
Email__afterOptOut ($email) | |
Trigger fired after an email address opts out of the email list. | |
Email__onFail (Dataface_Record $recipient, Dataface_Record $email) | |
Trigger fired after an email is attempted to be sent, but fails. | |
Email__onSuccess (Dataface_Record $recipient, Dataface_Record $email) | |
Trigger fired after an email is successfully sent. |
A false interface used to document that methods that can be implemented in the application delegate class to affect the functioning of the Email module.
Definition at line 6 of file ApplicationDelegate.php.
decorateEmailContext | ( | Dataface_Record | $email, |
Dataface_Record | $template, | ||
Dataface_Record | $recipient | ||
) |
A hook that is called just before an email is sent. This gives you an opportunity to add or modify data that is being sent.
It's best not to modify any information in the $email
or $template
since these are loaded once per batch of emails. Hence if you modify any of the information in them it will affect all subsequent emails sent in the same batch.
You may want to modify data in the $recipient
, which is used to populate macros in the email body.
Dataface_Record | The email record that is being sent. This includes the email content prior to the recipient macros being filled in. This record encapsulates a single row from the xataface__email_newsletters table. This value is never null . | |
Dataface_Record | $template | The template record that was used as a basis for this email. If no template was used then this value will be null . You may want to use the template as a marker for you to perform custom code that affects the recipient. |
Dataface_Record | $recipient | The recipient record. This encapsulates a row from the entity table upon which the found set we are sending email to was formed. This record is used to draw values for the embed macros so you can affect the values of the embed macros by modifying them in this record. |
This example looks for a particular template, and if the email uses this template, it resets the recipient's password to 'changeme'. Presumably this template draws on the 'password' field to send it to the recipient as part of the email.
Email__afterOptIn | ( | ) |
Trigger fired after an email address opts into the email list.
String | The email address that was opted in. (i.e. added to the blacklist) |
Email__afterOptOut | ( | ) |
Trigger fired after an email address opts out of the email list.
String | The email address that was opted out (i.e. added to the blacklist). |
Email__isBlackListed | ( | ) |
Checks whether a particular Email address is blacklisted. This will complement or supplement the existing blacklist table check depending on the return value of this method.
If it returns a boolean value (true or false), then this value will be treated as definitive (i.e. will completely override the built-in blacklist). If it returns any other value (e.g. 1, 0, null, ", etc...), then the result is ignored, and the standard blacklist is used.
String | The email address the check against the blacklist. |
Email__onFail | ( | Dataface_Record | $recipient, |
Dataface_Record | |||
) |
Trigger fired after an email is attempted to be sent, but fails.
Dataface_Record | $recipient | Record to which delivery was attempted. This will be a record of the table on which the "Send Email" option was selected. It should implement the Person ontology. |
Dataface_Record | The email record from the xataface__email_newsletters table. |
Email__onSuccess | ( | Dataface_Record | $recipient, |
Dataface_Record | |||
) |
Trigger fired after an email is successfully sent.
Dataface_Record | $recipient | Record that was sent to. This will be a record of the table on which the "Send Email" option was selected. It should implement the Person ontology. |
Dataface_Record | The email record from the xataface__email_newsletters table. |
getEmailOptOutMessage | ( | Dataface_Record | $recipient, |
$url | |||
) |
A hook that can optionally override the "opt-out" message that is added at the end of an email.
If this is not defined then a default message will be used with a link to the page where the user can opt out of the email list.
Dataface_Record | $recipient | The recipient record where the email is being sent. |
string | $url | The URL to the opt-out form. |
Note that you can override the default opt-out message in the conf.ini file also using the opt_out_html or opt_out_text directives in the modules_Email section.