Documentation
¶
Overview ¶
Package mailrail reads mail-merge jobs from a persistent queue and sends them via Amazon SES.
Each job contains template for the text and/or HTML versions of an email, as well as a list of recipients with associated per-recipient data to be merged into the templates. See the `Spec` type.
Mailrail backs off in response to SES's backpressure signals in order to avoid exceeding the SES sending rate limits.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var DoNotMangle = Mangler{ShouldSend: true, Mangle: identityAddr, SesService: nil}
Mangler that does not interfere with email sending.
var DoNotSend = Mangler{ShouldSend: false, Mangle: identityAddr, SesService: nil}
Mangler that prevents emails from being sent.
var SendToSimulator = Mangler{ShouldSend: true, Mangle: alwaysAddr("success@simulator.amazonses.com"), SesService: nil}
Mangler that causes all emails to be sent to the SES simulator.
Functions ¶
func ProcessForever ¶
Wait forever for new jobs and process them.
Types ¶
type Mangler ¶
Manglers allow for stubbing behavior so the system can be tested without sending emails to the actual recipeints. There are some predefined manglers (`DoNotMangle`, `DoNotSend`, `SendToSimulator`) and some predefined functions that return manglers (`SendToMe`, `UseMockSesService`). You can also make your own.
func UseMockSesService ¶
func UseMockSesService(ses sesService) Mangler
Returns a mangler that uses a mock SES service.
Directories
¶
Path | Synopsis |
---|---|
cmd
|
|
mailrail-submit
The submit command adds a spec to a pqueue.
|
The submit command adds a spec to a pqueue. |
mailrail-worker
Worker that processes mailrail jobs from a pqueue.
|
Worker that processes mailrail jobs from a pqueue. |