Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 452
Steve Avatar asked Nov 24 '14 00:11

Steve


People also ask

How long does it take for SendGrid to send email?

SendGrid takes 0 to 603.03 seconds to deliver each message.

How many emails can you send per day with SendGrid?

Once you create a sender identity a, you can send 100 emails per day. If you need to send more than that, complete your account setup to upgrade to a paid plan!

What does processed mean in SendGrid?

1. Processed. This event fires when SendGrid receives an individual message and prepares it to be delivered. Think of this as the top of the funnel-unless it is dropped (see below), each message you push to SendGrid will create a processed event.


2 Answers

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.

like image 73
Rob Donovan Avatar answered Oct 03 '22 20:10

Rob Donovan


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.

like image 27
rylanb Avatar answered Oct 03 '22 21:10

rylanb