Skip to content

Commit

Permalink
readme file
Browse files Browse the repository at this point in the history
  • Loading branch information
numen31337 committed Apr 22, 2021
1 parent b2fd274 commit 91d3e34
Showing 1 changed file with 51 additions and 2 deletions.
53 changes: 51 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,54 @@
Swift wrapper for the mailjet send API. With additional feature to archive attachments.
Unofficial Swift wrapper for the [mailjet send API v3.1](https://dev.mailjet.com/email/guides/send-api-v31/). With additional feature to archive attachments.

### Info

This library only supports text messages (no HTML). All attachments will be archived in a single `attachments.zip' archive file. All JPEG files will be excluded from the archive and directly attached to the message.

### Usage

...
##### Init the sender object with your credentials
```swift
let sender = MailjetSender(publicKey: "myPublicKey", privateKey: "myPrivateKey")
```

##### Send the email
```swift
sender.send(
from: "contact-us@your_domain.com",
fromName: "Sender",
to: "contact-us-inbox@your_domain.com",
toName: "Support",
replyTo: "reply_to@email.address",
attachments: attachments,
subject: "My subject",
message: "My message"
)
```

### Fields

`from`: Sender email address.

`fromName`: Optional, sender name.

`to`: Receiver email address.

`toName`: Optional, sender name.

`replyTo`: Optional, `Reply-To` address.

`attachments`: Optional, set of attachments wrapped in `NamedFile` objects.

`subject`: Subject of the email

`message`: Message body

`completion`: Optional, completion block that returns an error if occurred. Returns `nil` instead of error in case of success.

### Installation

##### SPM
Repository: `https://github.com/numen31337/mailjet_sender.git`, Branch: `main`

##### CocoaPods
`pod 'MailjetSender', :git => 'https://github.com/numen31337/mailjet_sender.git'`

0 comments on commit 91d3e34

Please sign in to comment.