Fix dayone client
This commit is contained in:
@@ -2,6 +2,6 @@ Hanami.app.register_provider :syndication, namespace: true do
|
|||||||
start do
|
start do
|
||||||
register "mastodon", Adamantium::Syndication::Mastodon.new
|
register "mastodon", Adamantium::Syndication::Mastodon.new
|
||||||
register "pinboard", Adamantium::Syndication::Pinboard.new(api_key: target["settings"].pinboard_api_key)
|
register "pinboard", Adamantium::Syndication::Pinboard.new(api_key: target["settings"].pinboard_api_key)
|
||||||
register "dayone", Adamantium::Syndication::Dayone.new
|
register "dayone", Adamantium::Syndication::Dayone.new(username: target["settings"].smtp_username, password: target["settings"].smtp_password)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@@ -3,15 +3,18 @@ require "mail"
|
|||||||
module Adamantium
|
module Adamantium
|
||||||
module Syndication
|
module Syndication
|
||||||
class Dayone
|
class Dayone
|
||||||
include Deps["settings"]
|
def initialize(username:, password:)
|
||||||
|
@username = username
|
||||||
|
@password = password
|
||||||
|
end
|
||||||
|
|
||||||
def call(name:, content:)
|
def call(name:, content:)
|
||||||
Mail.defaults do
|
Mail.defaults do
|
||||||
delivery_method :smtp, {
|
delivery_method :smtp, {
|
||||||
address: "smtp.fastmail.com",
|
address: "smtp.fastmail.com",
|
||||||
port: 465,
|
port: 465,
|
||||||
user_name: settings.smtp_username,
|
user_name: @username,
|
||||||
password: settings.smtp_password,
|
password: @password,
|
||||||
authentication: "plain",
|
authentication: "plain",
|
||||||
tls: true,
|
tls: true,
|
||||||
openssl_verify_mode: "peer"
|
openssl_verify_mode: "peer"
|
||||||
|
Reference in New Issue
Block a user