This repository has been archived by the owner on Jun 27, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 120
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GITBOOK-1290: [6.8] Send welcome email to a user
- Loading branch information
1 parent
7cc1e58
commit c5a646f
Showing
2 changed files
with
70 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
69 changes: 69 additions & 0 deletions
69
...i/rest-api/endpoints/user-management/users-endpoints/send-user-welcome-email.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
# Send User Welcome Email  | ||
|
||
Send welcome email to a user. It requires the `Send Emails` [permission](https://docs.rocket.chat/use-rocket.chat/workspace-administration/permissions). | ||
|
||
<table><thead><tr><th width="166">HTTP Method</th><th width="307">URL</th><th>Requires Auth</th></tr></thead><tbody><tr><td><code>POST</code></td><td><code>api/v1/users.sendWelcomeEmail</code></td><td><a href="../../authentication-endpoints/"><code>yes</code></a></td></tr></tbody></table> | ||
|
||
## Payload Parameters <a href="#payload-parameters" id="payload-parameters"></a> | ||
|
||
| Argument | Example | Description | | ||
| --------------------------------------------- | ---------------- | ----------------------------------------------------------- | | ||
| `email`` `<mark style="color:red;">`*`</mark> | test@example.com | The email address of the user to send the welcome email to. | | ||
|
||
## Example Call | ||
|
||
```bash | ||
curl --location --request POST http://localhost:3000/api/v1/users.sendWelcomeEmail\ | ||
--header 'X-Auth-Token: myauth-token' \ | ||
--header 'X-User-Id: myuser-name' \ | ||
--data-raw '{ | ||
"email":"test@email.com" | ||
}' | ||
``` | ||
|
||
## Example Response | ||
|
||
### Success | ||
|
||
```json | ||
{ | ||
"success": true | ||
} | ||
``` | ||
|
||
### Errors | ||
|
||
The following error can occur upon the endpoint. | ||
|
||
* **Authorization**: Requires an authentication token for the request to be made. | ||
* **SMPT not configured**: SMTP is not properly configured on your workspace | ||
|
||
{% tabs %} | ||
{% tab title=" Authorization" %} | ||
```javascript | ||
{ | ||
"success": false, | ||
"error": "unauthorized" | ||
} | ||
``` | ||
{% endtab %} | ||
|
||
{% tab title="SMPT not configured" %} | ||
```json | ||
{ | ||
"success": false, | ||
"error": "SMTP is not configured [error-email-send-failed]", | ||
"errorType": "error-email-send-failed", | ||
"details": { | ||
"method": "sendWelcomeEmail" | ||
} | ||
} | ||
``` | ||
{% endtab %} | ||
{% endtabs %} | ||
|
||
### Change Log <a href="#change-log" id="change-log"></a> | ||
|
||
| Version | Description | | ||
| ------- | ----------- | | ||
| 6.8.0 | Added | |