Skip to content

Commit c13a0f8

Browse files
committed
email readme
1 parent ccd241e commit c13a0f8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

examples/sending emails/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,18 @@ Email services solve these problems by providing reliable APIs for sending email
2525

2626
Here'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
3031
set 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

0 commit comments

Comments
 (0)