18 ms·
Exactly! This is why Lisp has dynamic variables: (let ((*emailer* mailgun-client)) (send email)) Or, using Go contexts (which are just a way of hack
by zeveb 11y ago
Exactly! This is why Lisp has dynamic variables:
(let ((*emailer* mailgun-client))
(send email))
Or, using Go contexts (which are just a way of hacking in dynamic variables):
ctx = email.NewContext(ctx, mailgunClient)
email.Send(ctx)
And in email.Send:
emailer, ok := EmailerFromContext(ctx)
if !ok {
emailer = defaultSMTPEmailer
}