Send a notification
notification.Send builds the message of the chosen package channel and delivers it to the
recipient you name, on demand.
One demo notification goes out through the framework's notification system and the channel that each package
registers, and one demo email goes through the SendGrid mail transport. A provider without credentials in
.env receives the request on a loopback recorder instead, so you see exactly what it would get
and nothing is sent.
notification.Send builds the message of the chosen package channel and delivers it to the
recipient you name, on demand.
mail.Use("sendgrid") sends one email through the SendGrid transport, which posts it to the
v3 Mail Send API.
| Provider | Mode | Set these variables in .env to make it live |
|---|---|---|
telegram |
dry-run | TELEGRAM_BOT_TOKEN |
whatsapp |
dry-run | WHATSAPP_ACCESS_TOKEN, WHATSAPP_PHONE_NUMBER_ID |
twilio |
dry-run | TWILIO_ACCOUNT_SID, TWILIO_AUTH_TOKEN, TWILIO_FROM |
netgsm |
dry-run | NETGSM_USERCODE, NETGSM_PASSWORD, NETGSM_HEADER |
iletimerkezi |
dry-run | ILETIMERKEZI_KEY, ILETIMERKEZI_HASH, ILETIMERKEZI_SENDER |
mutlucell |
dry-run | MUTLUCELL_USERNAME, MUTLUCELL_PASSWORD, MUTLUCELL_ORIGINATOR |
sendgrid |
dry-run | SENDGRID_API_KEY |
A live provider really sends when you submit a form, so use your own number or chat. Mail is sent through
SendGrid only for the form above; the application's default mailer stays MAIL_MAILER.
Available for new projects
I am Özkan Özcan. I ported, tested and published every package in this demo, and I can do the same for your code: