<commit_before>[PostageApp](http://postageapp.com) for CodeIgniter
===================================================

This is the gem used to integrate CodeIgniter apps with PostageApp service.
Personalized, mass email sending can be offloaded to PostageApp via JSON based API.

### [API Documentation](http://help.postageapp.com/faqs/api) &bull; [PostageApp FAQs](http://help.postageapp.com/faqs) &bull; [PostageApp Help Portal](http://help.postageapp.com)

Docs are coming<commit_msg>documentation<commit_after>[PostageApp](http://postageapp.com) for CodeIgniter
===================================================

This is the gem used to integrate CodeIgniter apps with PostageApp service.
Personalized, mass email sending can be offloaded to PostageApp via JSON based API.

### [API Documentation](http://help.postageapp.com/faqs/api) &bull; [PostageApp FAQs](http://help.postageapp.com/faqs) &bull; [PostageApp Help Portal](http://help.postageapp.com)

[PostageApp](http://postageapp.com) for CodeIgniter
===================================================

This is the gem used to integrate CodeIgniter apps with PostageApp service.
Personalized, mass email sending can be offloaded to PostageApp via JSON based API.

### [API Documentation](http://help.postageapp.com/faqs/api) &bull; [PostageApp FAQs](http://help.postageapp.com/faqs) &bull; [PostageApp Help Portal](http://help.postageapp.com)

Installation
------------
 - Copy both `system/application/config/postageapp.php` and `system/application/libraries/PostageApp.php`
 - Edit `config/postageapp.php` to include your PostageApp Project API key.

Usage
-----
PostageApp for CodeIgniter works very similarly to built-in Email class. Here's a simple example:

    $this->load->library('postageapp);
    
    $this->postageapp->from('<EMAIL>');
    $this->postageapp->to('<EMAIL>.test');
    $this->postageapp->subject('Example Email');
    $this->postageapp->message('Example Message');
    $this->postageapp->attach('/path/to/a/file.ext');
    
    $this->postageapp->template('test-template');
    $this->postageapp->variables(array('variable' => 'value'));
    
    $this->postageapp->send(); # returns JSON response from the server

If you wish to send both html and plain text parts call message function like this:
    
    $this->postageapp->message(array(
      'text/html'   => 'html content',
      'text/plain'  => 'text content'
    ));
    
You can set headers all in one go:

    $this->postageapp->headers(array(
      'subject' => 'Example Subject',
      'from'    => '<EMAIL>'
    ));
    
Recipients can be specified in a number of ways. Here's how you define a list of them with variables attached:

    $this->postageapp->to(array(
      '<EMAIL>' => array('variable1' => 'value',
                                        'variable2' => 'value'),
      '<EMAIL>' => array('variable1' => 'value',
                                        'variable2' => 'value')
    ));
    
For more information about formatting of recipients, templates and variables please see [documentation](http://help.postageapp.com/faqs)
{'fraction_non_alphanumeric': 0.18313953488372092, 'fraction_numerical': 0.0012919896640826874, 'mean_word_length': 3.908082408874802, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 43, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1235804', 'n_tokens_mistral': 905, 'n_tokens_neox': 877, 'n_words': 242}