forked from chatwoot/chatwoot
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Enable email channel (chatwoot#1851)
- Loading branch information
1 parent
6aed01d
commit ca4a766
Showing
15 changed files
with
54 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
db/migrate/20210303192243_rename_channel_email_forward_address.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
class RenameChannelEmailForwardAddress < ActiveRecord::Migration[6.0] | ||
def change | ||
rename_column :channel_email, :forward_to_address, :forward_to_email | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,9 +13,7 @@ | |
SuperAdmin.create!(email: '[email protected]', password: '123456') | ||
|
||
account = Account.create!( | ||
name: 'Acme Inc', | ||
domain: 'support.chatwoot.com', | ||
support_email: ENV.fetch('MAILER_SENDER_EMAIL', '[email protected]') | ||
name: 'Acme Inc' | ||
) | ||
|
||
user = User.new(name: 'John', email: '[email protected]', password: '123456') | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,13 +29,18 @@ | |
describe 'Support' do | ||
let!(:channel_email) { create(:channel_email) } | ||
|
||
before do | ||
it 'routes support emails to Support Mailbox when mail is to channel email' do | ||
# this email is hardcoded in the support.eml, that's why we are updating this | ||
channel_email.email = '[email protected]' | ||
channel_email.save | ||
channel_email.update(email: '[email protected]') | ||
dbl = double | ||
expect(SupportMailbox).to receive(:new).and_return(dbl) | ||
expect(dbl).to receive(:perform_processing).and_return(true) | ||
described_class.route support_mail | ||
end | ||
|
||
it 'routes support emails to Support Mailbox' do | ||
it 'routes support emails to Support Mailbox when mail is to channel forward to email' do | ||
# this email is hardcoded in the support.eml, that's why we are updating this | ||
channel_email.update(forward_to_email: '[email protected]') | ||
dbl = double | ||
expect(SupportMailbox).to receive(:new).and_return(dbl) | ||
expect(dbl).to receive(:perform_processing).and_return(true) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters