28 lines
673 B
Go
28 lines
673 B
Go
package mail
|
|
|
|
import "time"
|
|
|
|
// Enquiry is one submission of the public site's contact form.
|
|
type Enquiry struct {
|
|
Name string
|
|
Email string
|
|
Servers string
|
|
Topic string
|
|
Message string
|
|
}
|
|
|
|
// SendEnquiry forwards a contact-form submission to the support address.
|
|
//
|
|
// Reply-To is the sender's address, not From: the message is sent by our own
|
|
// SMTP identity so it passes SPF, but hitting reply must reach the person who
|
|
// filled the form in.
|
|
func (s Sender) SendEnquiry(to string, e Enquiry) error {
|
|
return s.sendTemplate(to, e.Email, "contact", struct {
|
|
Enquiry
|
|
Received string
|
|
}{
|
|
Enquiry: e,
|
|
Received: time.Now().UTC().Format(time.RFC1123),
|
|
})
|
|
}
|