twentyhq / twenty

Building a modern alternative to Salesforce, powered by the community.
https://twenty.com
GNU Affero General Public License v3.0
15.7k stars 1.7k forks source link

Customize the email onboarding Settings #5912

Open Bonapara opened 2 months ago

Bonapara commented 2 months ago

Current Behavior

Today, we ask which level of information a user wants to share with their team while syncing their email for the first time during onboarding.

image

Desired Behavior

We want to reduce the choices to either "Everything" or "Metadata only" to create more space to ask if the user wants to exclude non-professional emails from being synchronized.

image

https://www.figma.com/design/xt8O9mFeLl46C5InWwoMrN/Twenty?node-id=33430-185278&t=QzHWEjAMYRBmJkM8-11

Blocked by ongoing work on Settings V2 by @bosiraphael

greptile-apps[bot] commented 2 months ago

To customize the email onboarding settings, follow these steps:

  1. Update the frontend component:

    • Locate the component responsible for rendering the email sync options during onboarding. This is likely in a file under src/components/onboarding/EmailSyncOptions.js.
    • Modify the options to only include 'Everything' and 'Metadata only'.
      const emailSyncOptions = [
      { value: 'everything', label: 'Everything' },
      { value: 'metadata', label: 'Metadata only' }
      ];
  2. Add the option to exclude non-professional emails:

    • Add a new checkbox or toggle to the same component for excluding non-professional emails.
      <Checkbox
      label="Exclude non-professional emails"
      checked={excludeNonProfessional}
      onChange={(e) => setExcludeNonProfessional(e.target.checked)}
      />
  3. Update the backend to handle the new option:

    • Locate the backend endpoint handling the email sync settings, likely in src/controllers/EmailSyncController.js.
    • Update the logic to process the new 'exclude non-professional emails' option.
      const { syncOption, excludeNonProfessional } = req.body;
      if (excludeNonProfessional) {
      // Logic to exclude non-professional emails
      }
  4. Update any relevant schemas or models:

    • Ensure that the new option is reflected in any relevant data models or schemas, likely in src/models/EmailSyncSettings.js.
      const EmailSyncSettingsSchema = new Schema({
      syncOption: { type: String, required: true },
      excludeNonProfessional: { type: Boolean, default: false }
      });

References

RobertoSimonini1 commented 2 months ago

can I work on this issue?

Bonapara commented 2 months ago

Sure @RobertoSimonini1, thanks for contributing!

RobertoSimonini1 commented 2 months ago

@Bonapara, before start working on it, should I wait the ongoing work by @bosiraphael?

bosiraphael commented 2 months ago

Hello @RobertoSimonini1, yes you should wait for the settings V2. They will be done by @charlesBochet and should be finished by the end of the following week :)

RobertoSimonini1 commented 2 months ago

@Bonapara ok, thanks :)