Email Setup with Heroku

The Issue

Setting up SMTP for Heroku apps is not working with SendGrid, Mailgun, or Gmail SMTP.

I have used the one-button install for Metabase on Heroku and configured a few dashboards. I then wanted to invite people and setup subscriptions so I looked into adding Sendgrid, Mailgun, and Gmail SMTP servers. None of these solutions are working to send an email. The UI says an email was sent. I can see the link in the Heroku logs with no errors but nothing sends with any of them.

From what I can tell Mailgun might be the best option as the Sendgrid Basic Auth send is no longer a great way and Metabase needs to update that integration according to (SendGrid)[https://docs.sendgrid.com/for-developers/sending-email/upgrade-your-authentication-method-to-api-keys#am-i-using-basic-authentication-with-username-and-password] and the (Setup script)[https://github.com/metabase/metabase/blob/master/bin/start#L34].

Please advise.

Settings

{
  "browser-info": {
    "language": "en-US",
    "platform": "MacIntel",
    "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.110 Safari/537.36",
    "vendor": "Google Inc."
  },
  "system-info": {
    "file.encoding": "UTF-8",
    "java.runtime.name": "OpenJDK Runtime Environment",
    "java.runtime.version": "1.8.0_322-heroku-b06",
    "java.vendor": "Oracle Corporation",
    "java.vendor.url": "http://java.oracle.com/",
    "java.version": "1.8.0_322-heroku",
    "java.vm.name": "OpenJDK 64-Bit Server VM",
    "java.vm.version": "25.322-b06",
    "os.name": "Linux",
    "os.version": "4.4.0-1097-aws",
    "user.language": "en",
    "user.timezone": "Etc/UTC"
  },
  "metabase-info": {
    "databases": [
      "mysql"
    ],
    "hosting-env": "heroku",
    "application-database": "postgres",
    "application-database-details": {
      "database": {
        "name": "PostgreSQL",
        "version": "13.5 (Ubuntu 13.5-2.pgdg20.04+1)"
      },
      "jdbc-driver": {
        "name": "PostgreSQL JDBC Driver",
        "version": "42.2.23"
      }
    },
    "run-mode": "prod",
    "version": {
      "tag": "v0.41.6",
      "date": "2022-01-10",
      "branch": "release-x.41.x",
      "hash": "296635f"
    },
    "settings": {
      "report-timezone": null
    }
  }
}

Hi @corbanb
The Heroku script lives elsewhere and there's a PR open about removing it:
https://github.com/metabase/metabase-deploy/pull/28/files

Thanks, @flamber for the response.

I moved away from the Heroku config and am now using the SMTP variables in the UI. But no luck. Is there something I am missing? What services does Metabase recommend using there?

Gmail gives Username and Password not accepted for me. Is there a service you all prefer here especially when using Heroku.

Thanks.

@corbanb
I don't understand what you mean by "moved away" - Heroku requires a deploy config.
Generally, I cannot recommend Heroku because of some of the limitations, which doesn't work well with Metabase.
Gmail requires App Password as far as I know. It doesn't support the old style anymore.

@flamber I'll check out the Gmail app password.

When you say limitations with Heroku what do you mean here? Seems very straightforward.

Is there a recommended way metabase prefers?

@corbanb Have a look at these issues: https://github.com/metabase/metabase/issues?q=is%3Aopen+is%3Aissue+label%3AOperation%2FHeroku
I would recommend any hosting, where you run either JAR or Docker.