mirror of
https://github.com/lingble/chatwoot.git
synced 2025-12-27 16:14:46 +00:00
This PR adds the following changes 1. Add `Imap::GoogleFetchEmailService` and `Google::RefreshOauthTokenService`. The `Google::RefreshOauthTokenService` uses `OmniAuth::Strategies::GoogleOauth2` which is already added as a packge 2. Update `Inboxes::FetchImapEmailsJob` to handle Google inboxes 3. Add SMTP settings for Google in `ConversationReplyMailerHelper` to allow sending emails ## Preview #### Incoming emails  #### Outgoing email  --------- Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
13 lines
479 B
Ruby
13 lines
479 B
Ruby
# Refer: https://learn.microsoft.com/en-us/entra/identity-platform/configurable-token-lifetimes
|
|
class Google::RefreshOauthTokenService < BaseRefreshOauthTokenService
|
|
private
|
|
|
|
# Builds the OAuth strategy for Microsoft Graph
|
|
def build_oauth_strategy
|
|
app_id = GlobalConfigService.load('GOOGLE_OAUTH_CLIENT_ID', nil)
|
|
app_secret = GlobalConfigService.load('GOOGLE_OAUTH_CLIENT_SECRET', nil)
|
|
|
|
OmniAuth::Strategies::GoogleOauth2.new(nil, app_id, app_secret)
|
|
end
|
|
end
|