From c5a646fadbc9e6f042523fac01bc308da32c6776 Mon Sep 17 00:00:00 2001 From: Funke Olasupo Date: Mon, 6 May 2024 14:36:12 +0000 Subject: [PATCH] GITBOOK-1290: [6.8] Send welcome email to a user --- SUMMARY.md | 1 + .../send-user-welcome-email.md | 69 +++++++++++++++++++ 2 files changed, 70 insertions(+) create mode 100644 reference/api/rest-api/endpoints/user-management/users-endpoints/send-user-welcome-email.md diff --git a/SUMMARY.md b/SUMMARY.md index 6e15646c..acb6b4ec 100644 --- a/SUMMARY.md +++ b/SUMMARY.md @@ -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) diff --git a/reference/api/rest-api/endpoints/user-management/users-endpoints/send-user-welcome-email.md b/reference/api/rest-api/endpoints/user-management/users-endpoints/send-user-welcome-email.md new file mode 100644 index 00000000..27a6e8bc --- /dev/null +++ b/reference/api/rest-api/endpoints/user-management/users-endpoints/send-user-welcome-email.md @@ -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). + +
HTTP MethodURLRequires Auth
POSTapi/v1/users.sendWelcomeEmailyes
+ +## Payload Parameters + +| Argument | Example | Description | +| --------------------------------------------- | ---------------- | ----------------------------------------------------------- | +| `email`` ``*` | 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 + +| Version | Description | +| ------- | ----------- | +| 6.8.0 | Added |