Commit graph

47 commits

Author SHA1 Message Date
Jordan Brough
59b31615ed
chore: Use "create!" and "save!" bang methods when not checking the result (#5358)
* Use "create!" when not checking for errors on the result
* Use "save!" when not checking the result
2022-09-13 17:40:06 +05:30
Tejaswini Chile
ea918d9c5a
fix: send confirmation email on re-adding agent (#5279)
Send confirmation email after re-adding the agent.

Fixes: #4951
2022-08-18 13:12:43 +05:30
Tejaswini Chile
ffec427513
fix: mention notification mail for empty contact name (#5091) 2022-07-22 15:37:24 +05:30
Sojan Jose
4187428729
chore: Update dependencies to the latest versions (#5033) 2022-07-15 09:51:59 +07:00
Aswin Dev P.S
31cdc63e18
fix: Remove IMAP and SMTP email validation (#4435)
* Remove IMAP and SMTP email validation
* Rename imap_email & smtp_email columns to imap_login & smtp_login respectively.
* Use channel email domain if inbound email domain not present
2022-04-11 07:07:20 -07:00
Aswin Dev P.S
5ee209c079
chore: Fix user email re-confirmation flow (#3581)
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/
2021-12-16 19:32:49 +05:30
Sojan Jose
1db82f235d
Chore: Improve confirmation flow for agents (#3519)
- Agents are redirected to the password reset page which confirms the agent as well as sets a new password.
2021-12-09 11:11:46 +05:30
Aswin Dev P.S
24e6a92297
feat: IMAP Email Channel (#3298)
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
2021-11-19 11:52:27 +05:30
Sojan Jose
a4c87f2052
chore: Handle attachments in Whatsapp Channel (#3299)
send and receive attachments in 360Dialog WhatsApp channels
2021-11-11 13:03:48 +05:30
Aswin Dev P.S
46867e89cb
feat: Ability to specify a subject line for outbound emails (#3168) 2021-10-27 13:09:29 +05:30
Pranav Raj S
99abbb8158
feat: Display sent status of emails in email channel (#3125) 2021-10-14 12:55:46 +05:30
Nithin David Thomas
68e697c379
feat: Support cc and bcc in email replies (#3098)
Co-authored-by: Tejaswini <tejaswini@chatwoot.com>
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2021-10-11 13:00:48 +05:30
Tejaswini Chile
eb80324eaa
feat: Add message content to mention email template (#2838) 2021-08-18 15:28:45 +05:30
Sojan Jose
e46aa1aa64
chore: Mark Facebook accounts for reconnection (#2405)
fixes: #2037
2021-08-01 18:15:39 +05:30
Sojan Jose
1bf7227843
chore: Fix emails being sent with the wrong translations (#2236)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2021-06-08 22:45:01 +05:30
Sojan Jose
c8b81b066b
chore: Add timeouts to requests (#2024) 2021-03-31 16:39:57 +05:30
Sojan Jose
dbf515ab5a
chore: Make SMTP environment variables configurable (#1868)
fixes: #1647
2021-03-12 15:37:06 +05:30
Sojan Jose
ca4a766b82
chore: Enable email channel (#1851) 2021-03-04 13:59:59 +05:30
Pranav Raj S
b93388b330
feat: Tag agents in a private note (#1688)
Co-authored-by: Sojan <sojan@pepalo.com>
2021-01-27 00:04:11 +05:30
Pranav Raj S
2c324d9421
feat: Allow custom email address for inbox (#1336) 2020-10-11 23:24:11 +05:30
Sojan Jose
31c07771e8
feat: Notification on new messages in conversation (#1204)
fixes: #895
fixes: #1118
fixes: #1075

Co-authored-by: Pranav Raj S <pranav@thoughtwoot.com>
2020-09-10 19:19:15 +05:30
Sojan Jose
a04ca24def
feat: Customisable Email Templates (#1095) 2020-08-06 15:21:06 +05:30
Pranav Raj S
6d4cfcceba
Chore: Update the usage of available_name instead of name (#1110)
Update the usage of available_name instead of the name
2020-08-01 18:30:47 +05:30
Pranav Raj S
1dd3573c39
bug: Fix emails if assignee is nil (#1106) 2020-07-31 15:57:19 +05:30
Pranav Raj S
2b1d445003
feat: Use display_name instead of name of the agent (#1097)
* feat: Use display_name instead of name of the agent
2020-07-27 22:19:26 +05:30
Sony Mathew
b803ae3300
Bugfix: Private notes in emails & broken Signup (#1068)
* 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
2020-07-20 12:47:02 +05:30
Sony Mathew
96efc44b82
Chore: Feature lock email settings in UI (#1065)
* 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.
2020-07-19 23:08:07 +05:30
Sony Mathew
7ca192615d
Chore: Move some email configs to ENV variables (#1064)
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.
2020-07-19 15:35:55 +05:30
Sony Mathew
7ef45e5844
Chore: Change the prefix in reply emails (#1060)
* 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.
2020-07-19 13:34:34 +05:30
Sony Mathew
d5a6f5e352
Enhancement: ability to send out an email without summary #1048 (#1049)
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
2020-07-15 16:33:52 +05:30
Sojan Jose
dafabac796
Chore: Minor bugfixes and housekeeping tasks (#896) 2020-06-02 23:50:39 +05:30
Sojan Jose
b7a583b2c4
Feature: Ability to switch between multiple accounts (#881)
* Feature: Ability to switch between multiple accounts

* Fix rubocop

* Fix assigned inboxes

* fix auth json

* Add account switcher in UI

* fix ordering on administrate

* Add switch accounts to sidebar

* add account id

* Fix schema.rb timestamp

* Revert "add account id"

This reverts commit 27570f50ef584cb9a5f69454f43f630b318c8807.

* Add a check for account

Co-authored-by: Pranav Raj Sreepuram <pranavrajs@gmail.com>
2020-05-26 22:38:48 +05:30
Sony Mathew
6230f4d796
Enhancement: Threaded email replies for a conversation (#885) (#886)
* 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
2020-05-22 18:14:18 +05:30
sony-mathew
35b2bdd074 Removed the un-neccessary attribute from msg create factory 2020-05-10 16:21:02 +05:30
sony-mathew
1a123a4f56 Spec for private messages not to be included in mails (#837) 2020-05-10 16:21:02 +05:30
Sojan Jose
96da27f1f6
Feature: User Notification Objects (#752)
Co-authored-by: Pranav Raj S <pranavrajs@gmail.com>
2020-05-01 14:53:43 +05:30
Sony Mathew
0b65526b85
Feature: Conversation Continuity with Email (#770)
* 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)
2020-04-30 20:20:26 +05:30
Sony Mathew
2aa92d46fc
Fixed confirmation email flaky tests (#534) (#735) 2020-04-17 15:48:23 +05:30
Sojan Jose
8b4df986bf
Chore: Enable Users to create multiple accounts (#440)
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>
2020-03-07 12:18:16 +05:30
Sojan Jose
cda65ea339
Feature: Conversation creation email notifications (#576)
* Clean up the mailers

* Disable assignment mailer if setting is turned off

* Email notifications on conversation create

* Specs
2020-03-01 19:06:13 +05:30
Sony Mathew
04d347f0ee Chore: Changed from email and reply to email for conversation email (#444) 2020-01-24 14:10:52 +05:45
Sony Mathew
d4b3ba4baa [#139] Send conversation emails (#442)
* [#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
2020-01-23 23:14:07 +05:45
Anto Dominic
4e9290ad76 Send emails via sidekiq (#380)
* 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
2019-12-25 03:03:02 +05:30
Sojan Jose
6a2f4e6673 Chore: Ability to configure Mailer sender emails [#339] (#342)
* Chore: Ability to configure Mailer sender emails [#339]

fixes : #339
fixes : #330

* update the documentation
2019-12-03 22:54:08 +05:30
Pranav Raj S
94c6d6db6f
🚨Fix Rubocop lint errors 2019-10-20 14:17:26 +05:30
Lauren
b89353b76c Feature/update confirmation email information (#145)
* 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
2019-10-14 14:24:58 +05:30
Pranav Raj S
bd7bd63aae
Fix url in emails, add frontendURL helper (#19)
Fixes #16
2019-08-25 19:59:28 +05:30