I’m creating a fairly simple website that needs to send emails to the site owner every time someone fills out the contact form.
Would it be possible to send email notifications while being able to host everything on the IC and without rigging up a wonky client side solution (basically just recreating a standard contact form experience on the IC)? What’s the best way to accomplish this?
@dpdp I found your ICQS Demo on Github, but wasn’t able to get it up and running on my end. However, it also looks like this would require the separate hosting of an oracle outside of the IC.
Currently we don’t have an IC way to send outgoing email from a canister. As for a contact form, you’d need to create a custom http_request method to handle the incoming message from the form submission. Check out this thread for implementation details: Question on http_request()
I was able to get a working contact form that can send emails without an oracle. It uses a 3rd party service called EmailJS, which gives the ability to make an API call from the client side without exposing SMTP credentials. It’s not a perfect solution, but it’ll work for now and my client is happy with it!
My client and I are thinking of packaging this contact form solution into a resource for the Dfinity dev community so that other IC websites can have working contact forms. First I’d like to implement a way to store all form submissions in the backend canister so that the information can be recovered if any of the notification emails fail to reach the destination inbox.