Fix dayone client

This commit is contained in:
2023-03-08 08:21:21 +11:00
parent 5ff7040292
commit 50658748c5
2 changed files with 7 additions and 4 deletions

View File

@@ -2,6 +2,6 @@ Hanami.app.register_provider :syndication, namespace: true do
start do
register "mastodon", Adamantium::Syndication::Mastodon.new
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

View File

@@ -3,15 +3,18 @@ require "mail"
module Adamantium
module Syndication
class Dayone
include Deps["settings"]
def initialize(username:, password:)
@username = username
@password = password
end
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,
user_name: @username,
password: @password,
authentication: "plain",
tls: true,
openssl_verify_mode: "peer"