Just a suggestion to make easier to adapt cl-sendgrid to different deployment strategies. How sensitive information like API-keys is stored and provided to the application can vary. Environment variables and encrypted files being the most common. So having the config values be retrieved using a generic function makes it easier for the potential users of this library to configure the way they provide the api-key in a way it best suits their needs.
(defgeneric api-key (config)
(:documentation "The Sendgrid private API key."))
(defgeneric default-sender (config)
(:documentation "The default 'from' address."))
(defclass config ()
((api-key :initarg :api-key :initform (error "…") :reader api-key)
(default-sender :initarg :default-sender :reader default-sender)))
Just a suggestion to make easier to adapt cl-sendgrid to different deployment strategies. How sensitive information like API-keys is stored and provided to the application can vary. Environment variables and encrypted files being the most common. So having the config values be retrieved using a generic function makes it easier for the potential users of this library to configure the way they provide the api-key in a way it best suits their needs.