Skip to content

Commit

Permalink
Feature/append email (#59)
Browse files Browse the repository at this point in the history
* OAuth2 connection update

* small update

* Update README.md

* After closure update

* Update README.md

* Update README.md

* notes updated

* feature/manage-emails

* README.md update

* afterclosure updates & exampls added

* README.md update

* feature/label-management (#3)

* README.md Update 1

* README.md minor updates

* README.md minor updates pt2

* README.md Update pt2

* README.md Update after-closure

* Google.mail.append() command added
  • Loading branch information
mouna-elmaazouzi committed May 3, 2024
1 parent df8363e commit b986c4c
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
- [Office365.user.list()](#office365userlist)
* [Google class](#google)
- [cs.NetKit.Google.new()](#csnetkitgooglenew)
- [Google.mail.append()](#googlemailappend)
- [Google.mail.createLabel()](#googlemailcreatelabel)
- [Google.mail.delete()](#googlemaildelete)
- [Google.mail.deleteLabel()](#googlemaildeletelabel)
Expand Down Expand Up @@ -1294,6 +1295,50 @@ var $google : cs.NetKit.Google
$oAuth2:=New OAuth2 provider($param)
$google:=cs.NetKit.Google.new($oAuth2;New object("mailType"; "MIME"))
```
### Google.mail.append()

**Google.mail.append**( *mail* : Text { ; *labelIds* : Collection } ) : Object <br/>
**Google.mail.append**( *mail* : Blob { ; *labelIds* : Collection } ) : Object <br/>
**Google.mail.append**( *mail* : Object { ; *labelIds* : Collection } ) : Object <br/>

#### Parameters
|Parameter|Type||Description|
|---------|--- |:---:|------|
|mail|Text &#124; Blob &#124; Object|->|Email to be append |
|labelIds|Collection|->|Collection of label IDs to add to messages. By default the DRAFT label is applied|
|Result|Object|<-|[Status object](#status-object-google-class)|


#### Description

`Google.mail.append()` appends *mail* to the user's mailbox as a DRAFT or with designated *labelIds*.

>If the *labelIds* parameter is passed and the mail has a "from" or "sender" header, the Gmail server automatically adds the SENT label.
#### Returned object

The method returns a [**status object**](status-object-google-class) with an additional "id" property:

|Property|Type|Description|
|---------|--- |------|
|id|Text|id of the email created on the server|
|success|Boolean| [see Status object](#status-object-google-class)|
|statusText|Text| [see Status object](#status-object-google-class)|
|errors|Collection| [see Status object](#status-object-google-class)|

#### Example

To append an email :

```4d
$status:=$google.mail.append($mail)
```

By default, the mail is created with a DRAFT label. To change the designated label, pass a second parameter:

```4d
$status:=$google.mail.append($mail;["INBOX"])
```

### Google.mail.createLabel()

Expand Down

0 comments on commit b986c4c

Please sign in to comment.