Wiki
Download
Manual
Eggs
API
Tests
Bugs
show
edit
history
You can edit this page using
wiki syntax
for markup.
Article contents:
== Outdated egg! This is an egg for CHICKEN 4, the unsupported old release. You're almost certainly looking for [[/eggref/5/send-grid|the CHICKEN 5 version of this egg]], if it exists. If it does not exist, there may be equivalent functionality provided by another egg; have a look at the [[https://wiki.call-cc.org/chicken-projects/egg-index-5.html|egg index]]. Otherwise, please consider porting this egg to the current version of CHICKEN. == Send Grid [[toc:]] === Description Provides a very simply api for sending email via [[http://sendgrid.com/|SendGrid]]. The api uses SendGrid's [[http://docs.sendgrid.com/documentation/api/web-api/mail/|web api]]. Currently only the sending of mail is supported, but other parts of the web api could be easily added. === Repository [[https://github.com/ThomasHintz/chicken-scheme-send-grid]] === Author [[/users/thomas-hintz|Thomas Hintz]] Contact me at t@thintz.com. === Requirements * [[HTTP Client]] * [[URI Common]] * [[Intarweb]] * [[JSON]] * [[SRFI-1]] * [[SRFI-18]] * [[base64]] === List of Parameters ==== {{api-user}} <parameter>(api-user user)</parameter> This is your SendGrid api user specified as a string. ==== {{api-key}} <parameter>(api-key key)</parameter> This is your SendGrid api key specified as a string. ==== {{api-version}} <parameter>(api-version version)</parameter> A string indicating the SendGrid API version to use. The default is "2". Version "3" is also supported. After December 9th, 2020, this library may set the default to "3" when support for version 2 is officially ended. As far as this library's interface, the input and output are the same for both API versions. === List of Procedures ==== {{send-mail}} <procedure>(send-mail #!key (subject #f) (text #f) (html #f) (from #f) (from-name #f) (to #f) (reply-to #f) (api-user (api-user)) (api-key (api-key)) files)</procedure> Takes all the required arguments, passes a request on to SendGrid, and returns the SendGrid response in list form. {{api-user}} and {{api-key}} are optional if you specified them as parameters. Only {{html}} or {{text}} needs to be specified. If {{html}} is specified, then the resulting email will be in HTML format. If both {{html}} and {{text}} are specified, then the resulting email will only include the contents of {{html}}. {{files}} is optional and is a list of alists containing file attachments. The alist for each file must contain the key {{filename}} -- a string, {{filepath}} -- a string, and {{content-type}} -- a symbol. Example of {{files}}: <enscript highlight=scheme> (((filepath . "/foo.txt") (filename . "foo.txt") (content-type . text/plain))) </enscript> === Example <enscript highlight=scheme> (use send-grid) (api-user "api-user") (api-key "api-key") (send-mail from: "example.from@example.org" to: "example.to@example.org" from-name: "Example Name" reply-to: "example-from@example.org" subject: "Example Subject" text: "Example text.") </enscript> === Version History ==== Version 3.0.0 Adding backwards compatible support for SendGrid API version 3. ==== Version 2.0.1 Add support for file attachments. (Thanks to Sven Hartrumpf) ==== Version 2 Fix some install bugs. ==== Version 1 Initial release.
Description of your changes:
I would like to authenticate
Authentication
Username:
Password:
Spam control
What do you get when you multiply 8 by 4?