Skip to content

Commit

Permalink
updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Guillaume DJIODJIO committed Nov 25, 2022
1 parent 3c1f2d1 commit e9128a8
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ This package uses mailgun as transporter for now...

To get started, run:

```
```js
npm i @monkey_king/sendemail
```

Expand All @@ -17,32 +17,32 @@ To use this package, you will need an account at https://www.mailgun.com/.

To use this, in an ECMAScript, you will need to:

```
import {sendemail} from '@monkey_king/sendemail'
```js
import { sendemail } from "@monkey_king/sendemail";

const send = () => {
sendemail(
auth, //required. will be the authentication object required by mailgun
//auth = {auth: {api_key: <Your private key>, domain: <Your domain>}}
sendemail(
auth, //required. will be the authentication object required by mailgun
//auth = {auth: {api_key: <Your private key>, domain: <Your domain>}}

sender, //required. string of the email sending the mail.
//It should be the same as the one used to create mailgun account
sender, //required. string of the email sending the mail.
//It should be the same as the one used to create mailgun account

recipient, //required. Array of the list of emails to send to. They should
// be verified emails if you are using a free foundation plan in mailgun
recipient, //required. Array of the list of emails to send to. They should
// be verified emails if you are using a free foundation plan in mailgun

subject, //required. string of the email subject
subject, //required. string of the email subject

emailContent, //required. html passed as a string (ex: '<h1>Hello everyone</h1>')
emailContent, //required. html passed as a string (ex: '<h1>Hello everyone</h1>')

callback, //optional, takes two params. (error, result) => ...
)
}
callback //optional, takes two params. (error, result) => ...
);
};
```

Example:

```
```js
import {sendemail} from '@monkey_king/sendemail'

const auth = {
Expand Down Expand Up @@ -72,12 +72,12 @@ const send = () => {

To use this, in an CommonJS, you will need to:

```
const {sendemail} = require('@monkey_king/sendemail')
```js
const { sendemail } = require("@monkey_king/sendemail");

/**
* Rest of code goes here as for ECMAScript
*/
* Rest of code goes here as for ECMAScript
*/
```

## What next?
Expand Down

0 comments on commit e9128a8

Please sign in to comment.