T
Twenty2d ago
Aps

Messages from custom channel

Hi everyone, I'm trying to understand how the messaging system works (GraphQL). I am referring to the relationships between the different entities: MessageChannel MessageThread Message MessageParticipant MessageChannelMessageAssociation ConnectedAccount ? <- not sure if relevant I couldn't find any documentation on this other than the GraphQL schema which has a very small description on each field but doesn't explain the full picture. If there is any documentation or Github thread on this please share! My goal is to use the existing message system to send arbitrary messages to a person on Twenty that are not coming from a real email provider. For context this is what I inferred from the entities themselves and tried to do: 1. createMessageChannel -> visibility: SHARE_EVERYTHING 2. createMessageThread 3. createMessage 4. createMessageParticipant 5. createMessageChannelMessageAssociation This partially worked, I'm not sure how the "role" of "from" or "to" impacts the thread. In general my results seemed inconsistent so I was wondering if there is any documentation or if anyone can explain them so I don't have to reverse engineer it in a way.
2 Replies
ɃØĦɆᵾS
ɃØĦɆᵾS2d ago
Here's an explanation I compiled few weeks ago - messageChannel is connected account which is available in Settings > Emails - messageThread contains all messages in thread - messageParticipant is a user(s) with whom thread has been created - message is just a message - messageChannelMessageAssociations maps messages from account's thread to Twenty's messageThreads The only problem I can recall with creating messages via API is after they're created, they're shown as "Not shared" so probably it all must start from creating arbitrary connectedAccount with visibility set to Everything
Aps
ApsOP2d ago
Thanks @ɃØĦɆᵾS , that's more/less what I gathered. I noticed that it is the MessageChannel that holds the visibility value that can be set to SHARE_EVERYTHING I'll try to test it 1 more time carefully in a bit and see if perhaps I did something wrong

Did you find this page helpful?