Users can change their email from profile settings. They will be logged out immediately. Users can log in again with the updated email without verifying the same. This is a security problem.
So this change enforce the user to reconfirm the email after changing it. Users can log in with the updated email only after the confirmation.
Fixes: https://huntr.dev/bounties/7afd04b4-232e-4907-8a3c-acf8bd4b5b22/
This change allows the user to configure both IMAP and SMTP for an email inbox. IMAP enables the user to see emails in Chatwoot. And user can use SMTP to reply to an email conversation.
Users can use the default settings to send and receive emails for email inboxes if both IMAP and SMTP are disabled.
Fixes#2520
* 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.
For the outgoing emails which has dependency on the incoming
part as well like the conversation continuity part, some of the
config variables used were entirely based on the account attributes.
But this is not true in case of self hosted situations where you have
multiple accounts and have a common config for incoming emails.
So moved out some of the attributes entirely dependednt on the account
to ENV with a fallback to the Global config.
Also, with this changes the name of the agent will be shown in the
email clinet with in the conversation rather than just the support
email address. This has a huge UX impact on the cutomer.
Modified all the necessary unit tests to reflect these changes.
Updated the .env.example file for the new ENV variable.
* Chore: Change the prefix in reply emails
In conversation continuity the reply to email was looking like
reply+to+{some_random_hex_id}@reply.chatwoot.com
Changed the prefix to just `reply` instead of `reply+to`.
* Chore: Change reply email prefix in outbound emails
Changed the prefix from `reply+to+` to just `reply+` in
the reply emails in the converstaion related outbound emails.
Right now as part of conversation continuity, we are using the
ConversationReplyMailer which sends a summary of messages including
the incoming messages when an agent replies. Ideally, we want
to send only the reply of that agent and not a summary when
Conversation continuity is enabled. Added the functionality
to send the reply email without summary. Added required unit
tests to cover the changes.
ref: #1048
* Added custom Message-ID and In-Reply-To headers for conversation reply emails
* Added new global config for the default domain (This is used in the above headers)
* Added migration to run the config loader to load the new global config value
* The subject of the conversation reply mailer was made static (This is required for threaded emails)
* Added required tests
* Added POC for mail inbox reply email
* created mailbox and migratuion for the same
* cleaned up sidekiq queues and added the queues for action mailbox and active storage
* created conversation mailbox and functionlaity to create a message on the conversation when it's replied
* Added UUID to conversation to be used in email replies
* added migration to add uuid for conversation
* changed parsing and resource fetching to reflect matching uuid and
loading conversation alone
* cleaned up conversation mailbox.rb
* Added content type & attribute for message
* Added the new reply email to outgoing emails
* Added migration to accounts for adding domain and settings
* Modified seeds to reflect this changes
* Added the flag based column on account for boolean settings
* Added the new reply to email in outgoing conversation emails based on conditions
* Added dynamic email routing in application mailbox
* Added dynamic email routing in application mailbox
* Added a catch all deafult empty mailbox
* Added annotation for account
* Added the complete email details & attachments to the message
* Added the complete email details to the message in content_attributes, like subject, to, cc, bcc etc
* Modified the mail extractor to give a serilaized version of email
* Handled storing attachments of email on the message
* Added incoming email settings, env variables
* [#138] Added documentation regarding different email settings and variables
* Fixed the mail attachments blob issue (#138)
* Decoided attachments were strings and had to construct blobs out fo them to work with active storage
* Fixed the content encoding issue with mail body
* Fixed issue with Proc used in apllication mailbox routing
* Fixed couple of typos and silly mistakes
* Set appropriate from email for conversation reply mails (#138)
* From email was taken from a env variable, changed it to take from account settings if enabled
* Set the reply to email correctly based on conversation UUID
* Added commented config ind development.rb for mailbox ingress
* Added account settings for domain and support email (#138)
* Added the new attributes in accounts controller params whitelisting, api responses
* Added options for the the new fields in account settings
* Fixed typos in email continuity docs and warnings
* Added specs for conversation reply mailer changes (#138)
* Added specs for
* conversation reply mailer
* Accounts controller
* Account and Conversation models
* Added tests for email presenter (#138)
* Specs for inbound email routing and mailboxes (#138)
Addresses: #402
- migrations to split roles and other attributes from users table
- make changes in code to accommodate this change
Co-authored-by: Sojan Jose <sojan@pepalo.com>
Co-authored-by: Pranav Raj Sreepuram <pranavrajs@gmail.com>
* [#139] Delayed emails for conversations
* Added the setex and get methods to Redis wrapper
* Set the priorities for the sidekiq queues
* Was not able to use mailhog for testing email in local, switched back to letter opener and added comments on using the SMTP settings
* Added after create hood in messages to queue the sending of mail after 2 minutes using sidekiq worker and also set the redis key for the conversation to avoid the email sending for every message
* Added the sidekiq worker to send the email and delete the conversation redis key
* Added the mailer and mail template
* mailer sends the last 10 messages along with the new messages from the time it was queued
* Send email only in development or if smtp config is set
* Send email only in development or if smtp config is set
* Set the SMTP_PORT in production variable
* Adding redis to circle CI
* Specs for the conversation email changes
* Added specs for conversation email sidekiq worker
* Added specs for conversation mailer
* Added specs in message model for the after create hook for notify email
* Send emails only when there is a reply from agent
* set development to use mailhog
* Adding comments for using letter opener
* add sidekiq web view if the user is an administrator
* add sidekiq setup configuration and support
* update devise to use delivery_later method and update test
* update conversation to use deliver_later instead of deliver
* Update Routes
* Add Procfile for Heroku One-Click Start
* updating docs
* update concurrency and Procfile for supporting Heroku Free Dyno
* update Procfile.dev
* Add `invited_by` foreign key to User
Allows for a User to be tied to the user who invited them
* Include `current_user` in new agent initialization parameters
* Add `shoulda-matchers` for testing associations
* Add Inviter information and associated account to welcome email
* Only show inviter info if applicable
* Update conversation spec for FFaker compatibility