Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solve #34 - Refactor support email Use Case #41

Merged
merged 3 commits into from
May 13, 2024

Conversation

FelipeGuzmanSierra
Copy link
Collaborator

@FelipeGuzmanSierra FelipeGuzmanSierra commented May 10, 2024

Closes #34

Context

On this PR, the support emais notification use case was refactored. For this:

  • A new BOT was added to fetch email from an Imap server
  • A new BOT was added to format the emails notifications

Example of us:

## FetchEmailsFromImap
params = {
  process_options: {
    refresh_token: "email server refresh token",
    client_id: "email server client it",
    client_secret: "email server client secret",
    token_uri: "email server refresh token uri",
    email_domain: "email server domain",
    email_port: "email server port",
    user_email: "email to be access",
    search_email: "email to be search",
    inbox: "inbox to be search"
  },
  write_options: {
    connection:,
    db_table: "use_cases",
    bot_name: "FetchEmailsFromImap"
  }
}

bot = Bot::FetchEmailsFromImap.new(options)
bot.execute

## FormatEmails
options = {
  read_options: {
    connection: {
      host: "localhost",
      port: 5432,
      dbname: "bas",
      user: "postgres",
      password: "postgres"
    },
    db_table: "use_cases",
    bot_name: "FetchEmailsFromImap"
  },
  process_options: {
    template: "emails template message"
  },
  write_options: {
    connection: {
      host: "localhost",
      port: 5432,
      dbname: "bas",
      user: "postgres",
      password: "postgres"
    },
    db_table: "use_cases",
    bot_name: "FormatEmails"
  }
}

bot = Bot::FormatEmails.new(options)
bot.execute

@FelipeGuzmanSierra FelipeGuzmanSierra self-assigned this May 10, 2024
@FelipeGuzmanSierra FelipeGuzmanSierra added the 👍 Feature New feature or request label May 10, 2024
@coveralls
Copy link

coveralls commented May 10, 2024

Pull Request Test Coverage Report for Build 9069180880

Details

  • 217 of 219 (99.09%) changed or added relevant lines in 5 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.09%) to 99.911%

Changes Missing Coverage Covered Lines Changed/Added Lines %
lib/v2/bot/format_emails.rb 36 38 94.74%
Totals Coverage Status
Change from base Build 9036914507: -0.09%
Covered Lines: 2249
Relevant Lines: 2251

💛 - Coveralls

@FelipeGuzmanSierra FelipeGuzmanSierra marked this pull request as ready for review May 10, 2024 22:30
@FelipeGuzmanSierra FelipeGuzmanSierra force-pushed the 34-refactor-support-email-use-case branch from 029944a to 96b2569 Compare May 10, 2024 22:32
@FelipeGuzmanSierra FelipeGuzmanSierra merged commit 935e4aa into main May 13, 2024
4 checks passed
@FelipeGuzmanSierra FelipeGuzmanSierra deleted the 34-refactor-support-email-use-case branch May 13, 2024 23:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
👍 Feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor support email Use Case
3 participants