heroku - Best practices for sending email to lots of recipients (Rails + SendGrid) -


i sending bulk emails rails app , plan on using sendgrid. assuming best send separate email each recipient (as opposed using bcc recipients). if true, should using delayedjob queue messages going on sendgrid, or safe throw 500 messages @ @ once? thanks!

500 messages isn't sendgrid. it's not blip on radar. worked company sent out 2.7 million emails in single month, , it's just blip.

with sendgrid api's capabilities, wouldn't sending out 500 emails, send one email has specific sendgrid api header set. why? because have ever tried send 500 individual email messages , timed how long takes? how a single email? single email's going quicker.

the sendgrid api has ruby example here: https://sendgrid.com/docs/integrate/code_examples/smtp_api_header_examples/ruby.html.

that's quite long winded , messy, let me simplify you. basically, set in email:

headers["x-smtpapi"] = { :to => array_of_recipients }.to_json 

sendgrid parse , send one email sent out array of recipients. seem recall ask limit 1000 recipients per email, wise split on multiple emails if wanted that. that when bring in delayed_job or resque gems deal it.

oh, , way you'll still need specify to address email make mail gem happy. had info@ourcompany.com that.

the sendgrid api support filters in emails, can have placeholder strings such {{ firstname }} and, assuming send through smtpapi header, "mail merge" on email , customize them.

it great deal of if read sendgrid api documentation. it's useful , provide super powerful.


Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -