Sending email via mailchannels on a preview domain

I'd like to send emails via mailchannels on my project's preview url (e.g. foo.pages.dev), to use my site's auth flow. Is this possible? I'm asking because usually Mailchannels requires TXT requires on the domain, which I can't set up on a preview domain. Or is it possible to use an API key with mailchannels instead?
6 Replies
Chaika
Chaika6mo ago
You could set it up on your pages.dev sending from your actual domain (example.com), but not sending from the pages.dev as like you said, you'd need the mailchannels txt record
jason
jasonOP6mo ago
oh! just using a from address that is set up on Cloudflare already for mailchannels will work?
Chaika
Chaika6mo ago
no, you'd have to create a mailchannels record on your domain that allows your pages.dev to send
jason
jasonOP6mo ago
Like this? Or as two separate TXT records? - Type: TXT - Name: _mailchannels - Value: v=mc1 cfid=existing-project.pages.dev cfid=new-project.pages.dev (This particular project does not need a custom domain. So I'd like to piggy back off another of my custom domains if possible)
Chaika
Chaika6mo ago
I believe you do just want one, just like that. The mailchannels api should tell you if it's missing auth if you do misconfigure it ps. mailchannels is convenient and free but not of the best security, there's some reasons you might want to use something else anyway: https://discord.com/channels/595317990191398933/779390076219686943/1152689451374477483
jason
jasonOP6mo ago
Thanks. WIll give that a read
Want results from more Discord servers?
Add your server