agile-france / propile

Community Conference Program Compiler (for Agile France)
2 stars 8 forks source link

Need to install a mail sender #22

Closed dboissier closed 10 years ago

dboissier commented 10 years ago

In the production, propile assumes that it is deployed on an Apache which runs on a Linux OS and it uses sendmail.

For the heroku PF, it cannot work, so we need a gem that could make the job.

Any idea ?

thenrio commented 10 years ago

can be configured

it should even work with any gmail smtp and there are many sass one : https://addons.heroku.com/#email-sms

dboissier commented 10 years ago

Hi,

Thanks for the tips. I will try using orga account.

dboissier commented 10 years ago

Hi,

I followed the guide but it requires tlsmail gem and some code to make it work with gmail.

Unless some crazy ruby guy would like to modify the mailer code, I will try the postmark add-on.

oelmekki commented 10 years ago

Hello,

Postmark require adding a gem and some configuration too, but that's not a problem.

I would recommend against using gmail for several reasons :

Let me know if postmark is your final decision and create an account on it, I'll implement it tonight.

dboissier commented 10 years ago

Hi Olivier,

I agree with you about postmark. We should make it work with gmail.

Now I succeed to send an email by gmail from my local env. I used my gmail account for a real life test.

I set production env vars in heroku config and push the code on origin/master and heroku/master. When I test by resetting the password from the heroku app, I get an 500 error. In the heroku logs, there is no detailed stacktrace.

Perhaps, I did something wrong in the configuration, could you please help me on that?

Thanks

Edit : It seems gmail has blocked the email from heroku because we use the orga account from a tiers application.

oelmekki commented 10 years ago

I agree with you about postmark. We should make it work with gmail.

Ok, but my point was to not use gmail and use postmark rather :)

I set production env vars in heroku config and push the code on origin/master and heroku/master. When I test by resetting the password from the heroku app, I get an 500 error. In the heroku logs, there is no detailed stacktrace.

Are we talking about the registration / login / authentication feature ? If so, please open an other issue.

dboissier commented 10 years ago

Hi,

Ok, but my point was to not use gmail and use postmark rather :)

Sorry, I did not well read your explanation.

Are we talking about the registration / login / authentication feature ?

Actually, I solved the problem by enabling external access from the orga account and now it is working.

Anyway, I am waiting for the decision from the organisation to add Postmark addon because it requires add credit card info the heroku account. If ok you will be able to integrate postmark in propile.

Thanks for helping us on this.

thenrio commented 10 years ago

As far as I remember, they have a mailchimp account ... And mailchimp heroku plugin does not require credit card, does it ? Check that ?

I was dumb when I said "gmail" : I know it works and I know it is a terrible idea to use it :)

oelmekki commented 10 years ago

Mailchimp is not a very good fit for transactional emails, as it is designed for newsletters. That said, they provide mandrill for that exact purpose (I think it's a separated paid account, though).

thbar commented 10 years ago

Mandrill is perfect for transactional email. You can use it for free up to 12k emails, and I think it doesn't even require a CC card (to be verified!). I'm using it on https://www.wisecashhq.com for all transactional emails, here is my configuration (adapted for Heroku ENV style):

    config.action_mailer.smtp_settings = {
      user_name: ENV['MANDRILL_USERNAME'],
      password: ENV['MANDRILL_PASSWORD'],
      domain: "www.yourdomain.com",
      address: "smtp.mandrillapp.com",
      port: 587,
      authentication: :plain,
      enable_starttls_auto: true
    }

You can configure DKIM and SPF to reduce the risk of being marked as spam, see here.

thbar commented 10 years ago

I meant: 12k emails per month.

dboissier commented 10 years ago

Hi,

I tried to add it but it requires to set CC info.

Anyway we need to do this if we want the app to get ready for the next week.

@oelmekki which mail service would you like to use?

thbar commented 10 years ago

Also to test emails in development (which I find convenient), you can use a local smtp then this configuration in development.rb:

  # MockSMTP configuration
  config.action_mailer.delivery_method = :smtp
  config.action_mailer.smtp_settings = {
    address: 'localhost',
    port: 1025
  }

together with tools like:

oelmekki commented 10 years ago

Good idea, but we already use that (config) :)

oelmekki commented 10 years ago

@oelmekki which mail service would you like to use?

Both postmark and mandrill are good fit. In need to chose between the two, I would go mandrill, since it's a bit more well established and we can thus be more confident in long term support.

dboissier commented 10 years ago

We have the "go" from the team. I add Mandrill Add-on right now

oelmekki commented 10 years ago

Ok, good. Will set this up tonight.