Configure mailer
This commit is contained in:
@@ -31,6 +31,8 @@ module Adamantium
|
||||
setting :from_email, default: nil
|
||||
setting :dayone_email, default: nil
|
||||
|
||||
setting :smtp_password, default: nil
|
||||
setting :smtp_username, default: nil
|
||||
# Micropub endpoints
|
||||
setting :micropub_media_endpoint, default: "", constructor: Types::Params::String
|
||||
|
||||
|
@@ -6,6 +6,18 @@ module Adamantium
|
||||
include Deps["settings"]
|
||||
|
||||
def call(name:, content:)
|
||||
Mail.defaults do
|
||||
delivery_method :smtp, {
|
||||
address: "smtp.fastmail.com",
|
||||
port: 465,
|
||||
user_name: settings.smtp_username,
|
||||
password: settings.smtp_password,
|
||||
authentication: "plain",
|
||||
tls: true,
|
||||
openssl_verify_mode: "peer"
|
||||
}
|
||||
end
|
||||
|
||||
Mail.deliver do
|
||||
to settings.dayone_email
|
||||
from settings.from_email
|
||||
|
Reference in New Issue
Block a user