cl-sendgrid
2022-07-08
Wrapper to SendGrid's API.
Send emails with the SendGrid API
On Quicklisp (2020-10):
(ql:quickload "sendgrid")
and on Ultralisp.
Create an account an set these variables:
(setf *email-config* '(:|api-key| "your private api key" :|from| "the default 'from' address."))
Send an email with send-email
:
(sendgrid:send-email &key to (from (getf *email-config* :|from|)) (reply-to (getf *email-config* :|reply-to|)) subject content (verbose *verbose*)) ;; #() ;; 202 ;; #<HASH-TABLE :TEST EQUAL :COUNT 10 {10079655A3}> ;; #<QURI.URI.HTTP:URI-HTTPS https://api.sendgrid.com/v3/mail/send> ;; #<CL+SSL::SSL-STREAM for #<FD-STREAM for "socket 192.168.1.11:36670, peer: 159.122.xxx.yyy:443" {1007880183}>>
It takes the time of a POST request.
TODO:
- make the "to" parameter accept a list of addresses.
- add "reply_to". It is a cons cell / a list with: an email address, a name.
See also
- https://github.com/40ants/mailgun (Mailgun: just a bit more overhead to getting started, a free plan a bit less free)
- https://github.com/CodyReichert/awesome-cl#email
Licence
MIT.