WP Manifestindependent plugin directory
manifest / email / dbm-content-transactional-communication

DBM content transactional communication

Transactional communication functionality for DBM content

★ 0stars

Install

Download source zip No release zip yet

This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.

Install straight from GitHub with WP-CLI:

wp plugin install https://github.com/developedbyme/dbm-content-transactional-communication/archive/refs/heads/master.zip
No built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.

Transactional communcaiton for Dbm content

API

Data structures

Enum: InitialSendType

  • both : Send both email and text message if contact details exist for each method
  • preferTextMessage : Send only text message if contact details exists, otherwise send email

Enum: SendTypeOption

  • email
  • textMessage

User

{
    id: int,
    permalink: url,
    name: string,
    gravatarHash: string
}

UserWithPrivateData extends User

{
    id: int (from User),
    permalink: url (from User),
    firstName: string,
    lastName: string,
    name: string (from User),
    email: string,
    gravatarHash: string (from User)
}

Endpoints

Send password reset verification

Sends a password reset verification, 6 digit number, by email and/or text message.

Request

POST /wp-json/wprr/v1/action/dbmtc/sendPasswordResetVerification

{
    sendType: InitialSendType (default: default),
    user: id (int) or email (string)
}

Response

{
    code: "success",
    data: {
        verificationId: int,
        sent: array of SendTypeOption
        availableOptions: array of SendTypeOption
    }
}

Errors

{
    code: "success",
    data: {
        message: "User not found"
    }
}

Re-send password reset verification

Resends a previously sent verification

Request

POST /wp-json/wprr/v1/action/dbmtc/resendPasswordResetVerification

{
    verificationId: int,
    sendType: SendTypeOption
}

Response

{
    code: "success",
    data: {
        sent: array of SendTypeOption
    }
}

Verify a password reset

Use the verification id and the code that the user has inputted in order to verify the reset

Request

POST /wp-json/wprr/v1/action/dbmtc/verifyResetPassword

{
    user: id (int) or email (string),
    verificationId: int,
    verificationCode: int
}

Response

{
    code: "success",
    data: {
        verified: boolean
    }
}

Set password with verification

Sets the user password after verification, and logs in the user

Request

POST /wp-json/wprr/v1/action/dbmtc/setPasswordWithVerification

{
    user: id (int) or email (string),
    verificationId: int,
    password: string
}

Response

{
    code: "success",
    data: {
        authenticated: boolean
        [userId: int],
        [user: UserWithPrivateData],
        [roles: array of string],
        [restNonce: string],
        [restNonceGeneratedAt: unix timestamp]
    }
}