Awesome Open Source
Awesome Open Source

Send emails with the SendGrid API

https://sendgrid.com/

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|))
                          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:

  • [X] make the "to" parameter accept a list of addresses.
  • [X] add "reply_to"

See also

Licence

MIT.


Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
Common Lisp (7,453
Email (2,584
Sendgrid (335
Email Sender (327
Related Projects