#Email last sent date field
1 messages · Page 1 of 1 (latest)
you can create a date field in the People object (call it "last email sent") and then build a workflow that gets triggered every time an email is sent, and updates the field. Would that work?
I made a plugin few months ago which updates the dates of last interaction based on message, you may want to check it out as a template for your own workflow or just use it as is (let me know if you get any bugs)
Thank you, where can I find your plugin?
I tried it, I got stuck here:
$ yarn auth
... ... ^
Error [ERR_REQUIRE_ESM]: require() of ES Module /opt/twenty/twenty/packages/twenty-apps/community/last-email-interaction/node_modules/uuid/dist-node/index.js from /opt/twenty/twenty/packages/twenty-apps/community/last-email-interaction/node_modules/twenty-sdk/dist/cli.cjs not supported.
Instead change the require of index.js in /opt/twenty/twenty/packages/twenty-apps/community/last-email-interaction/node_modules/twenty-sdk/dist/cli.cjs to a dynamic import() which is available in all CommonJS modules.
at Object.<anonymous> (/opt/twenty/twenty/packages/twenty-apps/community/last-email-interaction/node_modules/twenty-sdk/dist/cli.cjs:2:194) {
code: 'ERR_REQUIRE_ESM'
}
I think this is related to the java version. I tried adding:
"resolutions": {
"chalk": "4.1.2"
}
inside: package.json but the error still happened the same.
Okay, mistake on my end, forgot to put yarn install in list of commands so full list looks like
cd packages/twenty-apps/community/last-email-interaction
yarn install
yarn auth
yarn sync
Thanks, however I did run 'yarn install ' before running the listed commands, I ran it without sudo but it did not work, so I ran it with sudo and it worked (I cloned the repository in to the same folder where twenty has its config files stored, so thats why it needed sudo, I think).
Out put of: yarn install
yarn install
➤ YN0000: · Yarn 4.9.2
➤ YN0000: ┌ Resolution step
➤ YN0000: └ Completed in 3s 609ms
➤ YN0000: ┌ Fetch step
➤ YN0000: └ Completed in 0s 331ms
➤ YN0000: ┌ Link step
➤ YN0000: └ Completed
➤ YN0000: · Done in 4s 214ms
But I still get the same error I listed above.
That's really weird 🤔
It's a clean new install of ubuntu server, and a fresh install of twenty 1.14.0
Yarn should be run without sudo as all it does is installing packages and it doesn't require higher privileges, also, yarn install at the root of the project installs all packages required only for development skipping entirely packages/twenty-apps folder
If you open packages/twenty-apps/community/last-email-interaction/application.config.ts in code editor (VS Code will suffice), does it show any errors?
I don't see any errors (I removed the 3 hash's before posting):
import { type ApplicationConfig } from 'twenty-sdk';
const config: ApplicationConfig = {
universalIdentifier: '718ed9ab-53fc-49c8-8deb-0cff78ecf0d2',
displayName: 'Last email interaction',
description:
'Updates Last interaction and Interaction status fields based on last received email',
icon: "IconMailFast",
applicationVariables: {
TWENTY_API_KEY: {
universalIdentifier: 'aae3f523-4c1f-4805-b3ee-afeb676c381e',
isSecret: true,
description: 'Required to send requests to Twenty',
},
TWENTY_API_URL: {
universalIdentifier: '6d19bb04-45bb-46aa-a4e5-4a2682c7b19d',
isSecret: false,
description: 'Optional, defaults to cloud API URL',
},
},
};
export default config;
I expect its something I'm doing wrong!
Did you delete those universalIdentifiers?
Yes, as maybe its not good to post them
But I did not delete them in the original file
They can be posted, they're available publicly in repo either way
And just to be sure, in src/index.ts there are also no errors? (you don't have to copy paste file content)
I can't see any errors in that file. I have not modified it. I can see that currently things are missing that would be set if the command worked, like the twenty url.
That's because those variables must be set in Twenty once app is synchronized with workspace
In Settings > Applications > Last email interaction to be precise
I will try removing and re download the code again. I will put it in on the users home folder instead of in /opt/twenty and see if it will work.
Honestly, it beats me why you're getting those errors, never heard of them before, it's definitely a matter of dependencies but why it happens, no idea
Thank you for your help, if it works I will let you know.
Hey you can always try clearing your server cache too
yarn command:prod cache:flush in packages/twenty-server
Still broken with the same error at the same place after running in the user home folder. I will have a look again another day. Thanks
@normal wyvern do you an idea by any chance why installing plugin on new machine generates errors related to twenty-sdk dependency?
I think I have an idea, which version of NodeJS are you using? You should be using NodeJS 24.5.0
my system says I'm using nodeJS 20.18.1
I will try to upgrade it, thanks.
You should not be able to install dependencies if you're not on the expected engines versions
Hey thank you for your patience on that. The error shows there is an incompatibility between ESM and CJS. What is your version of yarn? yarn --version
It could be an issue with twenty-sdk that ships cli with cjs instead of mjs. I would like to reproduce the issue before, @short shale you pulled the twenty repository, then cd to last-email-interaction, then launched yarn install then yarn auth that's it?
can you try with uuid version 8 also?
I upgreaded node to v24. It worked properly, I was able to run 'yarn auth'
4.9.2 is the version i get from running: yarn --version
After running yarn auth and yarn sync. I visited Settings > Integrations (in 1.14.0 of twenty the menu link in settings for the Integrations page is missing). I can't find where in the config to switch it back on. But if I go to the URL directly I can access the Integrations page, but I can't see the 'Last email interaction' showing up there at all.
What is the url path for the Settings > Applications > Last email interaction? And do you know what to search for in the config to get this to show up in the setting menu? Many thanks.
This is correct, I also ran:
sudo apt update sudo apt install git nodejs npm -y sudo npm install --global yarn
before yarn install on a clean install of Unbuntu server. As you can see it was the node version that was the problem now its on v24 not v20 and its working now.
There must be Applications with new chip in Workspace section in Settings, that's where you set up the variables
This is what I can see.
Thank you,
Yes, self-hosted
I don't have this featureFlag. In options it's set to: all group and all sources.
Yes, this one is not available in the admin pannel, you need to add it manually in core.featureFlag database table
Thank you, where can I find instructions on how to do that?
I can tell you, do you have access to your database?
Great, I have full access to the machine.
ok, then you should connect to your database, and add a new line IS_APPLICATION_ENABLED true for your workspace Id in core.featureFlag table
do you know how to get your workspaceId?
Can I ask some novice questions!
- Will this brake any functionality when updating TwentyCRM?
- Should I avoid playing with this on a version we use for work? If yes I can find some time in the future to install a local development version to experiment with.
- To access the data base, this using is CLI into the data base, correct? If yes, then I also need to look this up as I have not CLI accessed a db for a long time!
- I don't know how to get my workspaceId!
Sorry if this is too much trouble!
no pb. I would play on a local version indeed, not your production
Will this brake any functionality when updating TwentyCRM?
It should not but extensibility is a work in progress so not very stable yet
you can connect using dbeaver for example
to get workspaceId, go to twenty, open console, go to network tab, refresh, look at the preview of first metadata request see data->currentWorkspace->id value
Thank you for the help with this, it's been very interesting. I will stop here for now. I will try this later on a local version sometime in February when I have a bit more time to play on this stuff. I will keep our production version standard, I really don't want to brake that, even though I have backups and snapshots.
Now that app's are in v1.20.0 of TwentyCRM I tried using last-email-interaction again. I got to yarn sync and then it failed with the following output:
`ubuntu:/opt/twenty/twenty/packages/twenty-apps/community/last-email-interaction$ yarn sync
👩💻 Workspace - default
🚀 Syncing Twenty Application
📁 App Path: /opt/twenty/twenty/packages/twenty-apps/community/last-email-interaction
❌ Serverless functions Sync failed: {
message: 'Field "syncApplication" of type "WorkspaceMigration!" must have a selection of subfields. Did you mean "syncApplication { ... }"?',
locations: [ { line: 3, column: 11 } ]`
In the UI the rows are empty as in the image bellow.
Oh, didn't know someone's still actually using it 😅
I'll take care of it today and update it to latest SDK version so that it'll be working
The reason for that is very simple, basically there were many updates since I implemented this plugin and I didn't update it as SDK is still not fully released so breaking changes are to be expected
Yes indeed. Things are going to be more stable soon
Should I use 0.8.0-canary.8 or 0.7.0?
0.8.0-canary.8
That makes sense, then maybe just wait for things to be stable, so you don't have to do extra work.
It needs to be done at some point either, I would say it doesn't really matter if it'll be done now or later as there'll be less breaking changes from now onwards
0.8.0 released guys