POSTGRES_PORT was not taking effect if provided separately
instead of using DATABASE_URL. This adds support for using
databases running on non-standard ports.
#1145#1147
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
* feat: added support mailbox to handle email channel (#140)
Added a new mailbox called 'SupportMailbox' to handle all the
incoming emails other than reply emails.
An email channel will have a support email and forward email
associated with it. So we filter for the right email inbox based on
the support email of that inbox and route this to this mailbox.
This mailbox finds the account, inbox, contact (create a new one
if it does not exist) and creates a conversation and adds the
email content as the first message in the conversation.
Other minor things handled in this commit:
* renamed the procs for routing emails in application mailbox
* renamed ConversationMailbox to ReplyMailbox
* Added a fallback content in MailPresenter
* Added a record saving (bang) versions of enabling and disabling
features in Featurable module
* added new factory for the email channel
refs: #140
* Bugfix: Private notes in emails
Private notes were sent in the emails as part of
conversation continuity. Fixed this issue.
Also made the changes to not even queue the mails
if message is a private note.
* Bugfix: Change issue with featurable in signup - passing array
* Bugfix: Added specs for checking private notes being sent in email
* Chore: Feature lock email settings in UI
The email settings under account settings needed to be
feature locked in a way different from teh current way for it
to be enabled for accounts in a self hosted scenario.
Some refactorings were also done along with this change.
1. There was a feature flag defined in code in account model called
domain_emails_enabled was used to check if the inbound emails was
enabled for the account. But there was already a feature flag called
"inbound_emails" defined in features.yml. So changed to use this to
check if inbound emails are enabled for an account.
2. Renamed and re-purposed existing `domain_emails_enabled` to
`custom_email_domain_enabled` to use for feature toggling the UI
for email settings.
3. To enable & disable multiple features using the featurable concern
we were passing an array of values. Changed this to accept a comma
separated set of values.
* Chore: Feature lock email settings in UI
Fixed the specs for accounts controller & removed
unneccessary code from Account seetings component in UI
* Chore: Convert newlines to <br>s
Removed the layout used while sending replies in
conversation continuity.
Converted the newlines in the messages to <br/> tags
for the correct HTML rendering.
* Chore: Bug fix in reply email domain
Renamed the function custom_email_domain_enabled to
inbound_email_enabled.
Fixed bug on setting reply emails's domain.
* Renamed concern from Feature to Featurable
* Feature: Installation config (#839)
* Added new model installtion config with corresponding migrations and specs
* Created an installation config yml (key value store model)
* Created a config loader module to load the installaltion configs
* Added this to the config loader seeder
* Changed the account before create hook for default feature enabling to use the feature values from installtion config
* Renamed the feature concern to Featurable to follow the naming pattern for concerns
* Added comments and specs for modules and places that deemed necessary
* Refactored config loader to reduce cognitive complexity (#839)
* Feature: Feature flags on account (#814)
* Added the new column on account model for managing feature flags
* Added the inbound email flag
* Locked the settings of this eature in account settings based on this
* Encapsulated the feature flaging as a concern. With this, we can re-use the same concern if we introduce this in other models like user or inbox or so.
* Added the features in the account api
* Changed Rails/FilePath style - rubocop issue
* Revert "Changed Rails/FilePath style - rubocop issue"
This reverts commit 3a42d3b9c9b3a2fde8bc7256fd704b6fcaf54040.
* Disabling rubocop on codeclimate as we already have this in CICD