File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -25,16 +25,18 @@ Email services solve these problems by providing reliable APIs for sending email
2525
2626Here's a complete example using Mailgun's API to send emails through SQLPage:
2727
28+ ### [ ` email.sql ` ] ( ./email.sql )
2829``` sql
2930-- Configure the email request
3031set email_request = json_object(
3132 ' url' , ' https://api.mailgun.net/v3/' || sqlpage .environment_variable (' MAILGUN_DOMAIN' ) || ' /messages' ,
3233 ' method' , ' POST' ,
3334 ' headers' , json_object(
35+ ' Content-Type' , ' application/x-www-form-urlencoded' ,
3436 ' Authorization' , ' Basic ' || encode((' api:' || sqlpage .environment_variable (' MAILGUN_API_KEY' ))::bytea , ' base64' )
3537 ),
3638 ' body' ,
37- ' from=Sender Name <noreply@' || sqlpage .environment_variable (' MAILGUN_DOMAIN' ) || ' >'
39+ ' from=Your Name <noreply@' || sqlpage .environment_variable (' MAILGUN_DOMAIN' ) || ' >'
3840 || ' &to=' || $to_email
3941 || ' &subject=' || $subject
4042 || ' &text=' || $message_text
You can’t perform that action at this time.
0 commit comments