easy automated email marketing
May 27, 2010 21:25

Develop your own MailBeez

Posted In: Development, featured


Technically MailBeez is a framework for developing Trigger Email Campaigns.

A new MailBeez module can be developed very quickly. You only need to focus on building the Trigger Query Loop. MailBeez is taking care of putting together the email with using a template and a content file, sending the email out. Each email is tracked so it won’t be sent twice.

Let me take you very quickly through the concept – it is probably most easy for you to start from an existing MailBeez Module.

Build your Trigger Query

The following example shows how the receipients for a Birthday Greeting are selected.
An remember:each receipient will receive exactly 1 email per year ;-)

[php]
class birthday extends mailbeez {

// (…) some settings here

function getAudience() {
$query_raw = "select c.customers_firstname, c.customers_lastname,
c.customers_id, c.customers_email_address, c.customers_dob,
date_format(c.customers_dob, ‘%d.%m.’) as date_of_birth
from " . TABLE_CUSTOMERS . " c
where date_format(c.customers_dob,’%m%d’) < ( date_format(now(),’%m%d’)+ " . MAILBEEZ_BIRTHDAY_BEFORE_DAYS . ")
and date_format(c.customers_dob,’%m%d’) > ( date_format(now(),’%m%d’)- ". MAILBEEZ_BIRTHDAY_PASSED_DAYS_SKIP . ")";

$query = mh_db_query($query_raw);
while ($item = mh_db_fetch_array($query)) {
// mandatory fields:
// – firstname
// – lastname
// – email_address
// – customers-id

$this->audience[$item['customers_id']] = array(
‘firstname’ => $item['customers_firstname'],
‘lastname’ => $item['customers_lastname'],
‘email_address’ => $item['customers_email_address'],
‘customers_id’ => $item['customers_id'],
‘date_of_birth’ => $item['date_of_birth']
);
}
return $this->audience;
}

// (…) and some settings here

}

[/php]

of course you can build whatever your want to fill the audience-array!

No restrictions: since MailBeez Modules are running in the catalog environment, you can include any functionality from you shop front-end.

Build the Email Template

Following the html-code in the file body_html.tpl

[html]

Happy Birthday!

<img src="$catalog_servermailhive/mailbeez/birthday/images/birthday_cake.png" border="0" hspace="0" vspace="0" width="256" height="256" align="right" >
<br>
<br>

firstname: $firstname<br>
lastname: $lastname<br>
customers id: $customers_id<br>
<br>
<hr noshade size="1">
email: $email_address<br>
birthday: $date_of_birth

[/html]

Using the common HTML Email template located in mailhive/common/templates the email will look like this:

Birthday Email

of course when sending the content will be personalized for the receipiente using the data you filled in to the array.

Imagine…

…how fast you can build Automatic Trigger Email Campaigns. Season Greetings, Holiday Greetings – you might give a Discount Coupon – can build within minutes! You can focus on building the Trigger Query and your are done.

Leave A Comment
s2Member®
osCommerce, CRE Loaded, Zen Cart, xtCommerce, xtc-modified, Gambio GX, DigiStore, osCMax are trademarks or registered trademarks (in respective order) of Harald Ponce de Leon, Chain Reaction Works, Zen Ventures LLC, xtCommerce, xtc-modified, Gambio, DigiStore and osCMax.
The Bees Images are licensed for MailBeez on www.istockphoto.com/mailbeez
Valid XHTML 1.0 Transitional     © 2011 MailBeez — All Rights Reserved.
Built with s2clean by Premium WordPress® Themes     Powered by WordPress®