Steve
Steve

Reputation: 181

Rails 3.2 Emails being delayed for 11 mins before processed by Sendgrid

I have a Rails 3.2 app running on Heroku using Action Mailer and Sendgrid to send single transactional emails. Currently when the app sends an email, the request doesn't get received by Sendgrid to send out for 11 minutes. When viewing the received email in the inbox, the time will read the time it was received, but if you open up the email, it has the time (11 minutes prior) that the email request was originally generated. This is what I have in production.rb:

ActionMailer::Base.smtp_settings = {
:address        => 'smtp.sendgrid.net',
:port           => '587',
:authentication => :plain,
:user_name      => ENV['SENDGRID_USERNAME'],
:password       => ENV['SENDGRID_PASSWORD'],
:domain         => 'heroku.com',
:enable_starttls_auto => true
}


config.action_mailer.delivery_method = :smtp
config.action_mailer.perform_deliveries = true
config.action_mailer.raise_delivery_errors = true

I've never encountered this problem with Rails 4.0 apps, so is this a known issue with Rails 3.2?

Upvotes: 12

Views: 5069

Answers (2)

rylanb
rylanb

Reputation: 614

Some answers from the SendGrid docs: https://sendgrid.com/docs/Classroom/Send/When_Emails_Are_Sent/seeing_a_delay_with_your_first_few_sends.html

Check shaunwhite above about getting ahold of support to expedite the process.

Upvotes: 1

Rob Donovan
Rob Donovan

Reputation: 575

I've had this also.

After talking with their support, its an intentional delay, put into the system on new accounts.

Their system needs to 'learn' that you are not a spammer before it will remove the delay.

They said it should only be delaying for 'a short period of time', and there is no other way to remove it, other than just send legitimate emails, and wait.

Upvotes: 27

Related Questions