<commit_before># Sendgrid-ios

This library allows you to quickly and easily send emails through SendGrid using Objective-C.

**Important:** This library requires [AFNetworking](https://github.com/AFNetworking/AFNetworking/wiki/Getting-Started-with-AFNetworking) 2.0 or higher.


```objective-c
sendgrid *msg = [sendgrid user:@"username" andPass:@"password"];   

msg.to = @"<EMAIL>";
msg.subject = @"subject goes here";
msg.from = @"<EMAIL>";
msg.text = @"hello world";   
msg.html = @"<h1>hello world!</h1>";
    
[msg sendWithWeb];    
```

## Installation

1. Install via Source

    1. Clone the repository.
    2. Copy sendgrid.m and .h files to your project.
    3. Import both sendgrid and AFNetworking in your project

## Usage

To begin using this library, create a new email object with your SendGrid credentials.
```objective-c
sendgrid *msg = [sendgrid user:@"username" andPass:@"password"];
```

Customize the parameters of your email message.
```objective-c
msg.tolist = @[@"<EMAIL>", @"<EMAIL>"];
msg.subject = @"subject goes here";
msg.from = @"<EMAIL>";
msg.text = @"hello world";   
msg.html = @"<h1>hello world!</h1>";
```
For the full list of available parameters, check out the [Docs](http://sendgrid.com/docs/API_Reference/Web_API/mail.html)

### Adding To addresses

You can add a single address using the to property of the mail object

```objective-c
msg.to = @"<EMAIL>";
```<commit_msg>updated readme on installation method<commit_after># Sendgrid-ios

This library allows you to quickly and easily send emails through SendGrid using Objective-C.

**Important:** This library requires [AFNetworking](https://github.com/AFNetworking/AFNetworking/wiki/Getting-Started-with-AFNetworking) 2.0 or higher.


```objective-c
sendgrid *msg = [sendgrid user:@"username" andPass:@"password"];   

msg.to = @"<EMAIL>";
msg.subject = @"subject goes here";
msg.from = @"<EMAIL>";
msg.text = @"hello world";   
msg.html = @"<h1>hello world!</h1>";
    
[msg sendWithWeb];    
```

## Installation via CocoaPods (Recommended Method)
[CocoaPods](http://cocoapods.org) is a dependency manager for Objective-C, which automates and simplifies the process of using 3rd-party libraries like Sendgrid and its dependencies in your projects. Simply add the lines below to your existing Podfile or make a new 'Podfile' that contain the lines below. 

#### Podfile

```ruby
platform :ios, '7.0'
pod 'sendgrid', '~>  0.1.0'
```

Run the following in the command line
```
pod install
```

Be sure to open up the xcworkspace file now instead of the xcodeproj file. 

## Alternative installation
Install via Source

    1. Clone this repository.
    2. Copy sendgrid.m and .h files to your project.
    3. Import both sendgrid and AFNetworking in your project

## Usage

To begin using this library, create a new email object with your SendGrid credentials.
```objective-c
sendgrid *msg = [sendgrid user:@"username" andPass:@"password"];
```

Customize the parameters of your email message.
```objective-c
msg.tolist = @[@"<EMAIL>", @"<EMAIL>"];
msg.subject = @"subject goes here";
msg.from = @"<EMAIL>";
msg.text = @"hello world";   
msg.html = @"<h1>hello world!</h1>";
```
For the full list of available parameters, check out the [Docs](http://sendgrid.com/docs/API_Reference/Web_API/mail.html)

### Adding To addresses

You can add a single address using the to property of the mail object

```objective-c
msg.to = @"<EMAIL>";
```
{'fraction_non_alphanumeric': 0.13965014577259474, 'fraction_numerical': 0.007288629737609329, 'mean_word_length': 4.446031746031746, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 24, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1903489', 'n_tokens_mistral': 1132, 'n_tokens_neox': 1051, 'n_words': 380}