Skip to content
This repository has been archived by the owner on Jun 27, 2024. It is now read-only.

Commit

Permalink
GITBOOK-1290: [6.8] Send welcome email to a user
Browse files Browse the repository at this point in the history
  • Loading branch information
Funke Olasupo authored and gitbook-bot committed May 6, 2024
1 parent 7cc1e58 commit c5a646f
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 0 deletions.
1 change: 1 addition & 0 deletions SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@
* [List User Teams](reference/api/rest-api/endpoints/user-management/users-endpoints/list-user-teams.md)
* [Report User](reference/api/rest-api/endpoints/user-management/users-endpoints/report-user.md)
* [Logout User](reference/api/rest-api/endpoints/user-management/users-endpoints/logout-user.md)
* [Send User Welcome Email ](reference/api/rest-api/endpoints/user-management/users-endpoints/send-user-welcome-email.md)
* [LDAP Endpoints](reference/api/rest-api/endpoints/user-management/ldap-endpoints/README.md)
* [LDAP Sync](reference/api/rest-api/endpoints/user-management/ldap-endpoints/ldap-sync.md)
* [Test LDAP Connection](reference/api/rest-api/endpoints/user-management/ldap-endpoints/test-ldap-connection.md)
Expand Down
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 |

0 comments on commit c5a646f

Please sign in to comment.