When a user creates an account with Email/Password I need my app to send an email to verify it.
I saw that on the Firebase Auth page there are templates for that (also for restore password and others), but how is it used? Or is there any other alternative? Like send a verification code or something.
Have you tried? It’s possible to connect your app to Google Apps Script, then send the email with Google Apps Script.
Generate a random integer with as many digits as you like. Save it in a variable.
Use the following code in Google Apps Script. Create the script in the account that you want to send the email as. Use GmailApp; EmailApp does not work with Gmail addresses.
function doGet(e) {
var verificationCode = e.parameter.code;
var address = e.parameter.address;
GmailApp.sendEmail(address, "Verify your account", "This is the verification code for your account: " + verificationCode + ".";
return ContentService.createTextOutput("Email sent." );
}
Deploy the web app as usual, remember to execute as your own Google account and make the script available to everyone, even those without a Google account. Copy the deployment URL.
To send the verification code, use a Web component with this URL and then use the Web.Get block.
Although I have a question. If I have a different domain, would I have access to Google Apps Script? For example, I want that instead of sending an email like “[email protected]” use my own domain, like “[email protected]”. Do you know if that is possible?
Where did you find this? This is not listed in the Google Apps Script quota limit. There is a limit for email size, but it doesn’t take up so much space.
Well, I was looking and MailApp has the function MailApp.getRemainingDailyQuota(), which returns an int with the value of remaining mails you can send.
For example:
function doGet(e) {
var quota = MailApp.getRemainingDailyQuota();
Logger.log("Remaining email quota: " + quota);
}
This returned 500 to some people. In my case it returned 95 (I used it 5 times), so the limit would be 100 for me.
However, that function only exists in MailApp, not in GmailApp. Since yesterday I was looking for something similar for GmailApp and I didn’t find anything. I only found that the normal gmail daily sending limit is 500 (that is, sending emails normally, without using GoogleAppScript or something similar), I don’t know if it’s the same limit.