inital commit
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user