Fix dayone client
This commit is contained in:
@@ -2,6 +2,11 @@ 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(username: target["settings"].smtp_username, password: target["settings"].smtp_password)
|
register "dayone", Adamantium::Syndication::Dayone.new(
|
||||||
|
username: target["settings"].smtp_username,
|
||||||
|
password: target["settings"].smtp_password,
|
||||||
|
to: target["settings"].dayone_email,
|
||||||
|
from: target["settings"].from_email
|
||||||
|
)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@@ -3,9 +3,11 @@ require "mail"
|
|||||||
module Adamantium
|
module Adamantium
|
||||||
module Syndication
|
module Syndication
|
||||||
class Dayone
|
class Dayone
|
||||||
def initialize(username:, password:)
|
def initialize(username:, password:, to:, from:)
|
||||||
@username = username
|
@username = username
|
||||||
@password = password
|
@password = password
|
||||||
|
@to = to
|
||||||
|
@from = from
|
||||||
end
|
end
|
||||||
|
|
||||||
def call(name:, content:)
|
def call(name:, content:)
|
||||||
@@ -22,8 +24,8 @@ module Adamantium
|
|||||||
end
|
end
|
||||||
|
|
||||||
Mail.deliver do
|
Mail.deliver do
|
||||||
to settings.dayone_email
|
to @to
|
||||||
from settings.from_email
|
from @from
|
||||||
subject name
|
subject name
|
||||||
body content
|
body content
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user