-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add password recovery emails using Postmark
- Loading branch information
Showing
5 changed files
with
199 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#lang racket/base | ||
;;; | ||
;;; Send mail using postmark | ||
;;; | ||
|
||
(provide send-reset-password-email) | ||
|
||
(require postmark ; from the postmark-client package | ||
json | ||
"secret.rkt") ; contains the server api key | ||
|
||
(define key (postmark postmark-api-token)) | ||
|
||
(require json) | ||
|
||
(define (send-reset-password-email email name-of-user action-url) | ||
; The model values will be injected into the template named "password-reset". | ||
; The template can be edited on Postmark's homepage. | ||
(define model (hasheq 'name name-of-user | ||
'action_url action-url)) | ||
|
||
(postmark-send-email-with-template | ||
key | ||
#:to email | ||
#:from "passwordreset@racket-stories.com" | ||
#:template-alias "password-reset" | ||
#:template-model model | ||
#:tag "reset-password")) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters