MAIL_URL is set locally, but is undefined in deploy to Galaxy RESOLVED


#1

Hi everybody, I haven’t been able to resolve this issue after trying every tweak I can think of. I’m getting this error whenever I send an email on the Galaxy deployed version of my app:

Error: Email protocol in $MAIL_URL (undefined) must be ‘smtp’ or ‘smtps’

The local version of my app sends it just fine. This is how I’ve set my environment variables:

{
  "galaxy.meteor.com": {
    "env": {
      "MONGO_URL": "mongodb://sweetvictory:password@ds157475.mlab.com:57475/sweet-victory",
      "MAIL_URL": "smtp://postmaster%40sweetvictory.io:password@smtp.mailgun.org:587"
    }
  },

This is the script I have to deploy in package.json:

"staging": "DEPLOY_HOSTNAME=us-east-1.galaxy-deploy.meteor.com meteor deploy oven.sweetvictory.io --settings settings-staging.json",

Any help would be greatly appreciated!!


#2

Resolved. I had to manually set process.env.MAIL_URL on the server startup. Though from the docs it seemed like it would set automatically, it didn’t.