inboundnow / inbound-mailer-retired

0 stars 1 forks source link

Generate Example Inbound Email #43

Closed atwellpub closed 9 years ago

atwellpub commented 9 years ago

Preparing the example email

Step 1 - Setup Email

Setup example email in Inbound Mailer. Create 2 variations. Setup content etc. Save.

Step 2 - Get Settings JSON

When building the example email use the UI to design/edit it's variations and then use this URL param to output it's settings in json format. An extra array key 'is_sample_email' is added to the json array. You do not need to send the email at all.

&inbound_generate_email_json=true

Step 3 Adding json to upgrade routine

The json text generated by our backend command is placed in the $email_settings variable.

https://github.com/inboundnow/inbound-mailer/blob/master/classes/class.activation.database-routines.php#L42-L69

Dummy stats are automatically generated while viewing the email. When preparing stats for a sent or automated email we check to see if the email settings contains 'is_sample_email' and if it does we generate dummy stats for it using the method below instead of attempting to query mandrill for email stats:

https://github.com/inboundnow/inbound-mailer/blob/master/classes/class.statistics.php#L42-L51