Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/append email #59

Merged
merged 24 commits into from
Apr 9, 2024
Merged
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
c8512bc
OAuth2 connection update
mouna-elmaazouzi Apr 19, 2023
03e32f8
small update
mouna-elmaazouzi Apr 19, 2023
0df8ca7
Merge branch 'main' of https://github.com/mouna-elmaazouzi/4D-NetKit
mouna-elmaazouzi Apr 19, 2023
daec4b3
Update README.md
mouna-elmaazouzi Apr 19, 2023
25a09d9
After closure update
mouna-elmaazouzi Apr 20, 2023
c324944
Update README.md
mouna-elmaazouzi Apr 20, 2023
2c668fd
Update README.md
mouna-elmaazouzi Oct 9, 2023
1e55aa8
notes updated
mouna-elmaazouzi Oct 10, 2023
7fda902
Merge pull request #2 from mouna-elmaazouzi/update-mail
mouna-elmaazouzi Oct 12, 2023
7535134
Merge branch '4d:main' into main
mouna-elmaazouzi Oct 13, 2023
c210b7b
Merge branch '4d:main' into main
mouna-elmaazouzi Dec 6, 2023
a76cf2f
feature/manage-emails
mouna-elmaazouzi Dec 6, 2023
9681f7b
README.md update
mouna-elmaazouzi Dec 6, 2023
66897f6
afterclosure updates & exampls added
mouna-elmaazouzi Dec 12, 2023
7d58686
README.md update
mouna-elmaazouzi Dec 12, 2023
2cc2cfd
feature/label-management (#3)
mouna-elmaazouzi Jan 10, 2024
f6faf51
Merge branch 'main' into main
mouna-elmaazouzi Jan 10, 2024
c55587b
Merge branch '4d:main' into main
mouna-elmaazouzi Feb 9, 2024
5f73156
Merge branch 'main' of https://github.com/mouna-elmaazouzi/4D-NetKit
mouna-elmaazouzi Feb 9, 2024
0ee40ab
Merge branch '4d:main' into main
mouna-elmaazouzi Feb 16, 2024
2a4e98e
Merge branch '4d:main' into main
mouna-elmaazouzi Feb 20, 2024
179e3de
Merge branch '4d:main' into main
mouna-elmaazouzi Mar 15, 2024
9fd0bfc
Merge branch '4d:main' into main
mouna-elmaazouzi Apr 3, 2024
7440827
Google.mail.append() command added
mouna-elmaazouzi Apr 3, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading