Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EmailAPI ¶
type EmailAPI interface {
// SendEmail sends an email.
//
// It takes the following parameters:
// - from: The sender of the email.
// - domain: The domain of the email service.
// - apiKey: The API key of the email service.
// - subject: The subject of the email.
// - to: The recipient of the email.
// - message: The message of the email.
// - attachment: The attachment of the email.
//
// It returns an error if there is an issue with sending the email.
SendEmail(from, domain, apiKey, apiSecret, subject, to, message string, attachment []string) error
}
EmailAPI is the interface for sending emails.
type EmailApiService ¶
type EmailApiService struct {
From string
Domain string
ApiKey string
ApiSecret string
Sender EmailAPI
}
EmailApiService is the implementation of the EmailAPI interface.
func NewEmailApiService ¶
func NewEmailApiService(from, domain, apiKey string, apiSecret string, sender EmailAPI) *EmailApiService
NewEmailApiService creates a new instance of the EmailApiService.
type KirimEmail ¶
type KirimEmail struct {
}
func (KirimEmail) SendEmail ¶
func (s KirimEmail) SendEmail(from, domain, apiKey, apiSecret, subject, to, message string, attachment []string) error
SendEmail sends an email using the kirim.email API.
It takes the following parameters:
- from: the sender's email address
- domain: the domain to use for the email
- apiKey: the API key for the kirim.email domain
- subject: the subject of the email
- to: the recipient's email address
- message: the email message
- attachment: an array of strings representing the paths to the files to attach
It returns an error if something goes wrong.
Click to show internal directories.
Click to hide internal directories.