inital commit

This commit is contained in:
2026-05-26 20:21:55 +02:00
parent 965f9d6ad4
commit 0ae20aa68d
21 changed files with 651 additions and 111 deletions

View File

@@ -20,7 +20,7 @@ import (
// Returns nil on success. ErrUnauthorized when not logged in.
// *SystemMessageError when FA rejects the send (recipient blocked, rate
// limited, etc.).
func (c *Client) SendNote(ctx context.Context, to string, subject string, body string) error {
func (c *Client) SendNote(ctx context.Context, to string, subject string, body string, opts ...Option) error {
to = strings.TrimSpace(to)
if to == "" {
return fmt.Errorf("fa: SendNote: empty recipient")
@@ -42,7 +42,7 @@ func (c *Client) SendNote(ctx context.Context, to string, subject string, body s
return fmt.Errorf("%w: SendNote: could not locate form key on /msg/pms/", ErrUnauthorized)
}
return nil
})
}, opts...)
if err != nil {
return err
}
@@ -53,7 +53,7 @@ func (c *Client) SendNote(ctx context.Context, to string, subject string, body s
v.Set("subject", subject)
v.Set("message", body)
v.Set("send", "Send Note")
_, err = c.postForm(ctx, urls.Host+"/msg/send/", v)
_, err = c.postForm(ctx, urls.Host+"/msg/send/", v, opts...)
return err
}