git.sr.ht/~pingoo/stdx@v0.0.0-20240218134121-094174641f6e/postmark/sender_signatures.go (about)

     1  package postmark
     2  
     3  // import (
     4  // 	"fmt"
     5  // 	"net/url"
     6  // )
     7  
     8  // type SenderSignature struct {
     9  // 	Domain              string
    10  // 	EmailAddress        string
    11  // 	ReplyToEmailAddress string
    12  // 	Name                string
    13  // 	Confirmed           bool
    14  // 	ID                  int64
    15  // }
    16  
    17  // type SenderSignaturesList struct {
    18  // 	TotalCount       int
    19  // 	SenderSignatures []SenderSignature
    20  // }
    21  
    22  // type DetailedSenderSignature struct {
    23  // 	// Domain associated with sender signature.
    24  // 	Domain string
    25  // 	// string of objects that each represent a sender signature.
    26  // 	EmailAddress string
    27  // 	// Reply-To email associated with sender signature.
    28  // 	ReplyToEmailAddress string
    29  // 	// From name of sender signature.
    30  // 	Name string
    31  // 	// Indicates whether or not this sender signature has been confirmed.
    32  // 	Confirmed bool
    33  // 	// Unique ID of sender signature.
    34  // 	ID int64
    35  // 	// DEPRECATED: See our [blog post](https://postmarkapp.com/blog/why-we-no-longer-ask-for-spf-records) to learn why this field was deprecated.
    36  // 	SPFVerified bool
    37  // 	// Host name used for the SPF configuration.
    38  // 	SPFHost string
    39  // 	// Value that must be setup at your domain registrar or DNS host in order for SPF to function correctly.
    40  // 	SPFTextValue string
    41  // 	// DKIM DNS text record has been setup correctly at your domain registrar or DNS host.
    42  // 	DKIMVerified bool
    43  // 	// DKIM is using a strength weaker than 1024 bit. If so, it’s possible to request a new DKIM using the RequestNewDKIM function below.
    44  // 	WeakDKIM bool
    45  // 	// DNS TXT host being used to validate messages sent in.
    46  // 	DKIMHost string
    47  // 	// DNS TXT value being used to validate messages sent in.
    48  // 	DKIMTextValue string
    49  // 	// If a DKIM renewal has been intiated or this DKIM is from a new Sender Signature, this field will show the pending DKIM DNS TXT host which has yet to be setup and confirmed at your registrar or DNS host.
    50  // 	DKIMPendingHost string
    51  // 	// Similar to the DKIMPendingHost field, this will show the DNS TXT value waiting to be confirmed at your registrar or DNS host.
    52  // 	DKIMPendingTextValue string
    53  // 	// Once a new DKIM has been confirmed at your registrar or DNS host, Postmark will revoke the old DKIM host in preparation for removing it permantly from the system.
    54  // 	DKIMRevokedHost string
    55  // 	// Similar to DKIMRevokedHost, this field will show the DNS TXT value that will soon be removed from the Postmark system.
    56  // 	DKIMRevokedTextValue string
    57  // 	// Indicates whether you may safely delete the old DKIM DNS TXT records at your registrar or DNS host. The new DKIM is now safely in use.
    58  // 	SafeToRemoveRevokedKeyFromDNS bool
    59  // 	// While DKIM renewal or new DKIM operations are being conducted or setup, this field will indicate Pending. After all DNS TXT records are up to date and any pending renewal operations are finished, it will indicate Verified.
    60  // 	DKIMUpdateStatus string
    61  // 	// The custom Return-Path domain for this signature. For more information about this field, please read [our support page](http://support.postmarkapp.com/article/910-adding-a-custom-return-path-domain).
    62  // 	ReturnPathDomain string
    63  // 	// The verification state of the Return-Path domain. Tells you if the Return-Path is actively being used or still needs further action to be used.
    64  // 	ReturnPathDomainVerified bool
    65  // 	// The CNAME DNS record that Postmark expects to find at the ReturnPathDomain value.
    66  // 	ReturnPathDomainCNAMEValue string
    67  // }
    68  
    69  // func (client *Client) GetSenderSignatures(count, offset int64) (SenderSignaturesList, error) {
    70  // 	res := SenderSignaturesList{}
    71  
    72  // 	values := &url.Values{}
    73  // 	values.Add("count", fmt.Sprintf("%d", count))
    74  // 	values.Add("offset", fmt.Sprintf("%d", offset))
    75  
    76  // 	err := client.request(requestParams{
    77  // 		Method: "http.MethodGet",
    78  // 		URL:    fmt.Sprintf("/senders?%s", values.Encode()),
    79  // 	}, &res)
    80  // 	return res, err
    81  // }