-
Notifications
You must be signed in to change notification settings - Fork 23
Description
I am using Sendgrid in my Rails application, when I add emails in TO and BCC/CC, then after sending the email through my application, TO email is working fine and I got the email, but when I logged in with the same BCC/CC email in my account(e.g. Gmail), then there is no TO email details and my BCC/CC email shifted in the TO field, so that my email (that means BCC/CC email) is showing into the TO field.
As per the default process, for the BCC email user, TO email details should be in the TO field and my email (BCC email) should show into the BCC field section. But it is not working like that.
Please let me know, how can I achieve this process, so that based on the default functionality, my BCC email will display into the BCC email field instead of TO field.
Following are my config in /initialzers/mail.rb
ActionMailer::Base.register_observer(TrackedEmailEvents)
ActionMailer::Base.smtp_settings = {
address: 'smtp.sendgrid.net',
port: 587,
domain: 'syncta.com',
authentication: :plain,
enable_starttls_auto: true,
user_name: ENV['SENDGRID_USERNAME'],
password: ENV['SENDGRID_SECRET']
}
SendGrid.configure do |config|
config.dummy_recipient = '[email protected]'
end
If i remove intercept it will work as expected, but i need intercepter as I m using X-SMTPAPI' header in observer
I also tried to move my config into config/environment as mentioned here but no success.
Ruby Version: ruby 2.5.1
Rails Version: 5.1.6