Readonly
attachmentsReadonly
beginReadonly
fromReadonly
htmlReadonly
iconReadonly
idReadonly
moduleReadonly
subjectReadonly
typeMarks the message as read
Returns true to show that it has been marked as read
const messages = await client.messages();
messages.every((msg) => msg.isRead()) // -> false
messages.forEach(async (msg) => !msg.isRead() && await msg.markAsRead());
messages.every((msg) => msg.isRead()) // -> true
const refetchedMessages = await client.messages(); // See if it updated on the server
messages.every((msg) => msg.isRead()) // -> true
// In a React project...
import React from 'react';
const Message = (props) => {
const { message } = props;
async function handleOnClick() {
await message.markAsRead();
}
return (
<button onClick={handleOnClick} style={{ color: message.isRead() ? undefined : 'red' }}>
<p>{message.subject.raw}</p>
</button>
)
}
export default Message;
Static
processGenerated using TypeDoc
Message class This is only returned as an array in
Client.messages()
method