Cord can send a Slack or email notification whenever a user is mentioned or when a thread is shared. By default, this notification contains a link to the page where the conversation happened. You have the option to redirect users to a custom URL instead.
Login to the Cord Console, click on your project, then click the Notifications tab.
Paste your URL into the "Redirect URI" field.
The notifications that Cord sends will contain a link to the URL you provided. Cord will add a query parameter cord_notifications
to this URI.
For example, if you provided the follow Redirect URI:
https:/cord-redirect?original-page=home
Cord will send you that URI with one additional parameter:
https:/cord-redirect?original-page=home&cord_notifications=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.TWF5IGFsbCB5b3VyIHdpbGRlc3QgZHJlYW1zIGNvbWUgdHJ1ZSEh.dQG0MD-iJd0ZNeOVbr6_UseoIwld8K92xtTvuK1yipk
The extra parameter has information about the notification. The parameter's value will be a JWT, signed with your project's secret, so that you know the redirect is coming from us.
You can see examples of the payload content for each notification type in the following steps.
Always start by verifying the cord_notification
JWT. See our authentication guide for more detail.
For new users, your redirect URI can serve a sign-up flow that is personalized using the data from the cord_notifications
payload.
For existing users, your redirect URI can simply redirect the user to the conversation. The URL of the conversation is always part of the cord_notifications
payload as shown in the examples below.
Alice mentions Bob and Bob clicks on the link in his email notification. Bob is taken to<redirect_uri>?cord_notifications=<data>
where data
is a JWT with the following payload:
{
notificationInfo: {
type: "email",
sharerDetails: {
userType: "Type of user the Alice is", // 'platform'
userID: "Alice's ID",
groupID: "Alice's group ID",
name: "Alice",
email: "Alice's email address", // could be null
profilePictureURL: "url to Alice's profile picture", // could be null
},
targetDetails: {
userType: "Type of user the Bob is", // 'platform' or 'slack'
userID: "Bob's ID",
groupID: "Bob's group ID",
name: "Bob",
email: "Bob's email address", // could be null
profilePictureURL: "url to Bob's profile picture", //could be null
},
messageID: "Cord ID of the message that mentions Bob",
threadID: "Cord ID of the thread that mentions Bob",
url: "page URL where Bob was mentioned",
timestamp: "time when Bob was mentioned",
},
}
Alice mentions Bob and Bob clicks on the link in his Slack notification. Bob is taken to<redirect_uri>?cord_notifications=<data>
where data
is a JWT with the payload below. Because Bob might not be a user of your product yet, we provide Bob's Slack user ID and Slack workspace ID.
{
notificationInfo: {
type: 'slack',
sharerDetails: {
userType: "Type of user the Alice is", // 'platform'
userID: "Alice's ID",
groupID: "Alice's group ID",
name: "Alice",
email: "Alice's email address", // could be null
profilePictureURL: "url to Alice's profile picture", // could be null
},
targetDetails: {
userType: "Type of user the Bob is", // 'platform' or 'slack'
userID: "Bob's ID",
groupID: "Bob's group ID",
name: "Bob",
email: "Bob's email address", // could be null
profilePictureURL: "url to Bob's profile picture", //could be null
},
messageID: "Cord ID of the message that mentions Bob",
threadID: "Cord ID of the thread that mentions Bob",
url: "page URL where Bob was mentioned",
timestamp: "time when Bob was mentioned",
},
}
Alice shares a Cord thread to a Slack channel. The URL of the thread in Slack will take users to <redirect_uri>?cord_notifications=<data>
where data
is a JWT with the following payload:
{
notificationInfo: {
type: 'sharedToSlackChannel',
sharerDetails: {
userType: "Type of user the Alice is", // 'platform'
userID: "Alice's ID",
groupID: "Alice's group ID",
name: "Alice",
email: "Alice's email address", // could be null
profilePictureURL: "url to Alice's profile picture", // could be null
},
targetDetails: {
userType: "slack",
groupID: "Slack ID of the channel's group",
slackChannelID: "Slack ID of the channel",
},
threadID: "Cord ID of the shared thread",
url: "page URL where Cord thread was created",
timestamp: "time when Cord thread was shared to Slack",
},
}
Alice shares a Cord thread to bob@mail.com. The URL in Bob's email will take Bob to <redirect_uri>?cord_notifications=<data>
where data
is a JWT with the following payload:
{
notificationInfo: {
type: 'sharedToEmail',
sharerDetails: {
userType: "Type of user the Alice is", // 'platform'
userID: "Alice's ID",
groupID: "Alice's group ID",
name: "Alice",
email: "Alice's email address", // could be null
profilePictureURL: "url to Alice's profile picture", // could be null
},
targetDetails: {
userType: null,
email: "bob@mail.com",
},
threadID: "Cord ID of the shared thread",
url: "page URL where Cord thread was created",
timestamp: "time when Cord thread was shared to email",
},
}
With your redirect URI configured in the Cord console, and your server ready to handle requests, you're all done.
Not finding the answer you need? Ask our Developer Community