Coder Social home page Coder Social logo

yugalxd / codeigniter-amazon-ses Goto Github PK

View Code? Open in Web Editor NEW

This project forked from joelcox/codeigniter-amazon-ses

0.0 2.0 0.0 692 KB

A CodeIgniter library to interact with Amazon Web Services (AWS) Simple Email Service (SES)

Home Page: http://joelcox.nl

License: MIT License

PHP 100.00%

codeigniter-amazon-ses's Introduction

CodeIgniter Amazon SES

A CodeIgniter library to interact with Amazon Web Services (AWS) Simple Email Service (SES). This library was designed with the standard CodeIgniter email class in mind. As a result, most methods look the same, ensuring a minimal learning curve.

NOTE: this code is still under heavy development and currently provides only the very basics of the AWS SES API (don't you like acronyms?), sending email.

Requirements

  1. PHP 5.1+
  2. CodeIgniter 2.0+
  3. libcurl with OpenSSL support
  4. Phil Sturgeon's CodeIgniter cURL library
  5. A bundle of public root certificates (e.g. http://curl.haxx.se/ca/cacert.pem)
  6. An Amazon Web Services account

Spark

This library is also released as a Spark. If you use this library in any other way, don't copy the autoload.php to your config directory.

Documentation

Configuration

This library expects a configuration file to function correctly. A template for this file is provided with the library.

Verify email address

Before you can send your first message, Amazon SES requires that you verify your email address. This is to confirm that you own the email address, and to prevent others from using it.

Request to verify your email address as a sender.

$this->amazon_ses->verify_address('[email protected]');

Check whether a email address is verified as a sender.

$this->amazon_ses->address_is_verified('[email protected]');

Recipients

Set the "To" address(es) for a message.

$this->amazon_ses->to('[email protected]');

Set the "CC" address(es) (carbon copy) for a message.

$this->amazon_ses->cc('[email protected], [email protected]');

Set the "BCC" address(es) (blind carbon copy) for a message.

$this->amazon_ses->bcc(array('[email protected]', '[email protected]', '[email protected]'));

These three methods expect valid e-mail addresses as a string, array or comma separated list.

###Message

Set the sender address. You can also set this in your config file. The second parameter - the vanity name of the sender - is optional.

$this->amazon_ses->from('[email protected]', 'Email monkey');

Set the subject for a message.

$this->amazon_ses->subject('Open me!');

Set the message to be sent.

$this->amazon_ses->message('<strong>Use HTML</strong>');

Set the alternative message (plain-text) to be sent. When not specified, an alternative message is generated by using PHP's strip_tags() function.

$this->amazon_ses->message_alt('No HTML?!');

Sends the message. Returns true on success. You can pass a boolean as a first parameter to preserve the recipients after the message has been successfully send. This makes it possible to send an additional message without re-specifying the recipients.

$this->amazon_ses->send();

NOTE: All methods above are chainable, which means you can do the following

$this->amazon_ses->to('[email protected]')->subject('Yo!')->message('Sup dawg')->send();

###Misc

Sends the message in debug mode. In debug mode, the send() methods returns the actual API response instead of a boolean. Call this method before calling the send method.

$this->amazon_ses->debug(TRUE);

Contributing

I am a firm believer of social coding, so if when you find a bug, please fork my code on GitHub and squash it. I will be happy to merge it back in to the code base (and add you to the "Thanks to" section). If you're not too comfortable using Git or messing with the inner workings of this library, please open a new issue.

Thanks to

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.