A simple Go (golang) library for sending email across a variety of existing services.
Currently, there are three supported implementations:
- noopSender - simply logs received messages
- amazonSESSender - sends email via Amazon SES
- smtpSender - sends email over SMTP
You to choose an implementation, you will set the value of the factory method for the implementation you want to use.
For example, to use the AmazonSESSender implementation:
NewSenderFactory = NewAmazonSESSender("endpoint-url", "access-key-id", "secret-access-key")
Then, you can initialize an email.Sender anywhere that requires it using the factory method:
sender := NewSenderFactory()
Currently, there are two supported MessageBody implementations. simpleMessageBody is simply a wrapper around a string and can be used to send very basic email messages.
The second implementation has been designed for HTML templates saved in files. This implementation is a light wrapper around Go's html/template package. An example of how to use this implementation is found in the integration tests