Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

User registration email is never received #3

Open
milikicn opened this issue Mar 11, 2016 · 0 comments
Open

User registration email is never received #3

milikicn opened this issue Mar 11, 2016 · 0 comments

Comments

@milikicn
Copy link

I have started the application and tried registering a new user so I could log in. Upon creating a new account, I am displayed with a message that the registration link has been sent to me. But I have never received the registration email.

Since emails are sent via postal library, one thing that might be the problem is that I am running the application from my local machine and the mode used for sending emails in Salava (ns salava.core.mail) is set to local. From the Postal Github page:

... [local] will locally inject the message into whatever sendmail-compatible interface your system provides.

I am not sure how technically this works, but I think the problem is that my machine does not fulfill this prerequisite.

If I change manually in the salava.core.mail namespace function send-mail to look like something like this (I will redact my AWS email server credentials with # sign), email sending will work. Similarly, you can set up any other SMPT server to send emails from (e.g. Gmail).

(defn send-mail [subject message recipients]
  (try+
    (let [host {:host    "email-smtp.us-east-1.amazonaws.com"
                    :user    "##################"
                    :pass    "#################################"
                    :port     587}
          data {:from    mail-sender
                    :to        recipients
                    :subject subject
                    :body    [{:type    "text/plain; charset=utf-8" 
                                   :content message}]}]
      (send-message host data))
    (catch Object _
      ;TODO log an error
      )))

Is there any other way to enable email sending or you think it makes sense to expand send-mail function (as per my example) and the config file resources/config/core.edn to include SMTP account details?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant