Google Apps Script - check if an email has sent properly - javascript

I'm working on a Google Apps Script project that sends an email when a button is clicked on a HTML sidepanel I've built. Currently the script works as planned and fires off an email when told, but I'm wondering if there's any way that it could check that the email sent correctly so I can notify the user that it's ok to close the tab?
Thanks in advance

If you are using the Gmail API to sending email, it will return the ID of the email that you can use to trace the email in your mailbox.
Google Script stores a copy of every sent email in the Gmail sent items folder. If you are using the GmailApp service, search the sent items for a copy of the email. If found, it was sent.
GmailApp.search("in:sent to:email#domain.com after:epoch_time")
You can use epoch time in Gmail search to find emails that were sent in the last minute or so.

Related

Verify emails using Google Apps Script

I have a list of email addresses in Google spreadsheet, I need to send them the same mail. so I wrote a script using Google Script that goes over the emails and send it.
My problem is that I am not sure that all the email addresses are valid. for example, name#gmaial.com instead of name#gmail.com. In this case, the mail won't be delivered.
I used Hunter API to achieve this, but I have a limited number of calls to theses API.
Can anyone help?

Open outlook email search from Java/JavaScript

Recently, I saw a form on SharePoint where user can select/search emails from a widget. It seemed to me that the emails were not locally stored and that SharePoint is somehow getting the emails from Outlook or an email server.
My question here would be that whether something like this is possible in Java/Javascript or not? So that I do not store emails locally and the search widget may bring the emails from an email server.
Thanks a lot.

Best way to implement no-password sign-in with Firebase

I'd like to simplify the authentication workflow in my Firebase app, and let users connect without password:
With third party OAuth providers: Facebook, Google, etc.
or
With email
If the later, the user would just fill in their address, receive a URL, and instantly get logged in without having to type/remember a password.
Whenever they logout, or, their session times out, they would enter their email again, and receive a new link to start a new session.
How to do that with Firebase?
I feel like it's not possible on the client, so what would be the best server side routine to achieve that workflow?
Finally, after taking some time to figure this out, I quickly realised that the email verification process cannot be used to solve this: the function to get this email sent can only be called by already logged-in users (which makes perfect sense). Hence it cannot be used to sign-in.
I ended up using this workflow with Firebase custom authentication :
CLIENT User asks to login, he's asked his email address, and told he will receive a link to complete log in upon form submission.
SERVER Receives the email address. Finds or creates user id belonging to that user, creates a custom token with this uid and sends an authenticated link by email (for example: http://myapp.com/?token=XYZ)
CLIENT User comes back in the app by clicking on that link, and the app can use the token parameter to immediately log-in the user using firebase.auth().signInWithCustomToken(token).
Look, ma, no passwud!
For Email part you can :-
Use custom passwords from Front-End eg:- timestamp's or some random words+timeStamp . And store that timeStamp in the users's Database for future reference for session expiration.
For sending a link for starting a session you can use the verification email to send a link inside and modulate the contents of the mail as per your needs.
For knowing when your session expire's:-
Just retrieve the timeStamp lets say that is timeKeyRetrieved
Check how much time has passed since the timeStamp
PS:- For checking wether user session has expired during the user is online. You will have to use timer. And whenever your users gets online just retrieve the timeStamp in AppDelegate methods or viewWillAppear:

parse.com - How to generate and add verification url within email?

I am using parse.com as backend for my android application.
On signup, an email is sent to user with the help of my parse cloud code and mailgun api integration. My code works fine for sending email.
But I am unable to understand how to add an auto-generated url within my mail, to verify the user's email address and save that information in the parse database.
What i have tried is, turning on email verification option, but don't know what to do next. Also, I am using my own domain for sending email and not parse one. Would really appreciate any help. Thanks
Goto your dashboard-> App Settings-> Hosting and Email. There you will able to find Email Settings. Enable "Verify User Emails" . DONE

Email API for connecting in a marketplace?

I'm looking into what it would take to add a feature to my site so this is a pretty naive question.
I'd like to be able to connect buyers and sellers via an email message once the buyer clicks "buy".
I can see how I could do this in java script, querying the user database and sending an email with both parties involved. What I'm wondering is if there's a better way I can do this, playing monkey in the middle so they only receive an email from my site, and the it's automatically forwarded to the other party. That way they don't have to remember to hit reply-all, just reply. Also their email addresses remain anonymous.
Again assuming I generate a unique subject line with the transaction ID I could apply some rules here to just automatically forward the email from one party to the other but is there an API or library which can already do this for you?
What you're describing would be handled largely by your backend. If this were my project, I would choose the following simple route:
Store the messages the buyers/sellers send in your own database, then simply send notification emails when messages are sent. Have them reply to each other on your own site, like Facebook and eBay do.
An example flow would go like this:
(Gather the user and buyer's email addresses via registration)
Buyer enters a message and clicks 'Send Message' button on seller's page
Form is posted (via AJAX or via POST) to a backend script
Your backend code generates an email message
Sets the 'To' field to the seller
Your seller gets an email alert of the potential buyer which shows the buyer's message
The Seller then logs on to your site (made easy by a URL in the email) to respond
The Seller enters a response message on your site and hits 'Reply'
Buyer gets an email notification with the message body and a link to your site where they can compose a reply.
...and so on. So, replies would have to be authored on-site, rather than as an email 'reply.'
If you choose to go this route, there are some simple 3rd party "transactional email" providers, which is the phrase you'd use to find them. I've personally used SendGrid and found them easy to set up and use. They have a simple plug in for every major framework. There is also Mandrill, which is newer but gets good reviews as well.

Categories