SendGrid-nodejs or Nodemailer? - node.js

There are at least two ways to send email from Nodejs using SendGrid:
Sendgrid provides a Nodejs library called "SendGrid-nodejs." They're actively supporting Sendgrid-Nodejs (last update 29 days ago).
Nodemailer supports sendgrid and seems to be extremely popular. SendGrid posted an article about using this combination: Sending email with Nodemailer and Sendgrid.
Edit 2
SendGrid have ended support for nodemailer-sendgrid-transport as of today.
So, if you're starting on a project now, I would suggest going with sendgrid-nodejs.
Original question:
Edit to make the question less opinion-based:
What are the pros and cons to each approach? I have googled for days and not seen any comparison of the two. There is another StackOverflow question asking for differentiation between the two (among several other things) which has gone unanswered. So surely the answer to this will help others.
My specific usage, in case it helps focus the answers:
I want to allow users of an iPhone app to invite others to use the app. They'll see the default invitation text in the app, and can customize it. The customized text is sent to my Nodejs server and added to a job queue. As the queue is processed, emails are sent. I want the emails to look nice, so I want to use HTML email templates (and a plaintext alternate body).
Scale-wise, this will start out very small but if the app is succssful could scale up rapidly.

You'll find that you can achieve what you want to do using either library (nodemailer-sendgrid-transport was written by SendGrid too!) but given you suggest that you want to use HTML templates and plain text alternatives, you might want to take a look at using the SendGrid Node JS library because it'll give you easier access to some more advanced features, such as:
Template Engine - Which allows you to manage both HTML and plain text templates inside the SG dashboard rather than in your code - this could be handy for making quick changes, without the need to redeploy your app to production.
Advanced Suppression Management - Which allows you to group emails that users can then unsubscribe from, rather than completely unsubscribing from everything, ever.
It's worth noting that you could still use both these features with NodeMailer and nodemailer-sendgrid-transport, but the SendGrid NodeJS library directly exposes methods for these features.
Like I said, you can achieve what you want with either but I thought it was worth pointing out a few SendGrid specific things.

Well, sendgrid-nodejs is a more popular repository.
However, Nodemailer is the most popular module for sending emails with NodeJS. I've been using it for months and I'm very satisfied.
If you're worried about the future of your app you should consider that Nodemailer is used not just with Sendgrid, but with a lot of other competitors. So if you have a problem with Sendgrid, you could easily switch to another email delivery service without having to learn a different API.
So I suggest you to use nodemailer-sendgrid-transport, and if you find bugs, fix them with a PR :P

Related

Paypal, angular 2 and expressjs server

I am new to web development and have put together a decent Angular 2 MEAN web-app that I would like to launch relatively soon. Unfortunately PayPals documentation is such a gigantic Kafkaesque clusterf maze swamp mire that I am lost in and have no clue what I'm doing, I have 30 browser tabs open including code examples and their node sdk/REST. I've tried a few of the different options on offer which involved pasting their scripts to try get a button but nothing happened. Does anyone have a simple guide I can follow and a simple recommendation for integrating paypal payments into MEAN stack? I just need to be able to set payment amounts based on data that is contained in objects I have access to in my front-end, so a simple front-end solution would be nice where user can pay with paypal account or credit card and where I can plug the variable {{event.price}} straight into paypals api and send it off, and verify it somehow.
Thanks

How to automatically set gmail filter via chrome extension?

I would like to implement the following use case as a Chrome extension:
user visits gmail
exension checks current email body for a keyword
if a keyword is present, a gmail filter is added and saved (adding label, archiving, the details are not important here)
The first part sounds easier: there is gmail API to work with and even a gmail.js project that should make it easier.
Adding filter seems to be much harder. There is email settings API doing precisely what I want but I am fairly sure it is usable only by business accounts (custom email domains, won't work for gmail.com). I want the solution to be more universal.
One thing I thought of was to use browser automation - upon seeing the trigger keyword, the script automatically clicks 'Add filter' link, waits for AJAX, sets filter parameters and confirms.
An example of simulated user activity is in this answer
This could happen either on gmail page behind the popup ('Please wait, adjusting filters') or in background tab to keep it from interfering with user's flow. This seems like ugly workaround for me, though.
Is there a more straightforward or simply better approach that I'm missing?
After more experimentation and reviving an older github project I found out that setting the filter for a logged in user can be achieved simply by issuing a specific POST message to gmail from the current session.
I don't fully understand the parameters used in this request (if anyone has better information, please share), but I found a sample code which was greatly helpful.
Second issue, widely discussed in gmail.js community, is that Gmail security policies will prevent you from injecting your own scripts. This is bypassed by method shown in this boilerplate project
I compiled these solutions to solve my particular use case. Here is an example project with my solution, which should work out of the box - and when in doubt, see readme.

Email Notifications Chrome Webstore Support

Is it possible to receive email notification for new comments on the Support page of a Chrome extension in the webstore?
On the support page of a Chrome extension I can add a new question, suggestion or bug report but I don't receive any notification about responses.
I had the same problem. I have several apps in the Chrome Web Store and I found it tedious to be constantly checking. I found an extension that claimed to have this functionality, though I found it periodically lost my list of extensions and wasn't able to actually fetch reviews consistently. You can try the extension here: https://chrome.google.com/webstore/detail/my-extensions/igejgfmbjjjjplnnlgnbejpkpdajkblm?hl=en. It is also open source, so it could be improved.
I ended up writing some of my own scripts to periodically check and send me an email when there is a new review or support request. I made it available to use as a hosted service (currently free, though I plan on asking for a little money to defray the hosting costs as well as some coffee money). Check out the hosted service at https://www.chromebeat.com. It has a full list of the Chrome webstore apps and extensions and can send you notifications on a new support issue or review. Right now it only checks hourly and sends on the hour.
Also, when you respond to a support request, the user who reported it doesn't get any kind of notification. The best way around that I've found is to actually message that person's Google+ profile, either by adding them to a circle (e.g. App users) posting publicly and mentioning them in the post, or for some users it's possible to message directly with hangouts.
[update: Oct 2015. It's now possible to "Reply" to reviews in the web store, so that's probably the best way to respond to user reviews directly]
As far as I know, there is no such option. You will have to periodically check it.
Which makes using the built-in Feedback quite useless - you're better off using something like a public bug tracker as your "Support" link and disabling Feedback.
Existing feature request: https://code.google.com/p/chromium/issues/detail?id=295837
As of 2015-03-23, it is untriaged.
No, that has not been implemented, even approaching a decade later.
New Solution:
The two options in the current answer are no longer working, so I made a small utility app to solve this problem.
You can submit your extension's id and your email address and Webstore Watch will notify you within 1 minute of a new support request.
https://gmanicus.github.io/WebstoreWatch/
Let me know if this goes down or if you experience problems. I can't guarantee 100% reliability, but I will do my best to maintain it.

Automatically create GMail filters based on externally hosted word list

I'd like to easily import a word list, hosted on Github, to GMail as archive filters. Then later re-run this process to update the list.
The goal is to provide blacklists against common known Finnish spammers.
Possible options I have considered
Bookmarklet
Using GMail API
Creating GMail Labs extension (or whatever they are called)
What kind API options I have for maintaining GMail filter list? Programming language does not matter.
Optionally this would be a single click / single command operation e.g. from terminal or browser bookmark.
Today I was curious about this myself, although for a different reason... I found this info and thought I'd risk a bit of necromancy :)
You should take a look at Gmail settings API - filters
There is a Java wrapper

"Hello world" as a Gmail plugin?

I am trying to find out what the tech is like to create a Gmail plugin that accesses my attachments. Just to get started, what would be "Hello world" as a Gmail plugin? What would be the steps to create it?
Yes, you can creates plugin for Gmail, and two types:
Sidebar
Contextual
Look for Gadgets in gmail. After learning how to use these, you can add them to your gmail or anybody that wants to can do the same, to do so you can have Google host it.
It's easy if you know some HTML, JavaScript, and XML.
Good Luck
Take a look at these links:
https://developers.google.com/google-apps/gmail/contextual_gadgets
https://developers.google.com/gadgets/docs/basic
You cannot create Gmail plugins.
(Unless you work for Google)
Doing some quick research it looks like Google now supports a GMail api to build gadgets and/or plugins. I haven't done it myself, however it seems like they want it to work.
https://developers.google.com/google-apps/gmail/
I think you can do that. (You will find Hello World program too)
http://code.google.com/apis/gmail/gadgets/contextual/
Last year, Google released a GMail API and it allows you to perform the actions you want, but perhaps not with the UX you're looking for embedded directly inside of GMail. You can find it here:
https://developers.google.com/gmail/api/
Depending on exactly how you need it to work, you might be able to use either Contextual Gadgets (https://developers.google.com/gmail/contextual_gadgets) or a Google Chrome Extension to do what you need.
Google has recently introduced add-ons for Gmail (probably on Oct, 24 2017). It can be developed with Google Apps Script. Google's documentation says
What Gmail add-ons can do ?
Displaying additional information for the user in the Gmail UI.
Connecting to non-Google services, to retrieve information or take other actions.
Providing an interactive interface to allow the user to control the add-on or send information to another service.
I am not pretty sure (will go deep into it in coming days) whether you can deal with attachments. But I logically feel you can do that as well, because GAS supports handling attachments.
As of now, Google is not allowing to publish new add-ons however they will allow it in future.
While a few add-ons have been made available in the G Suite
Marketplace for users to install, it is not currently possible to
publish your own add-on to the Marketplace.
How can you publish your own add-on ?
As of now (26th Oct, 2017), they consider it on request basis. If you have a cool idea, fill this form to let them know about it. You will get notified once they accept your listing.
Here is how the add-on interface looks like inside Gmail
It is not possible to create plugins for Gmail. There is no developer API as such - only access to send/retrieve emails using standard SMTP/IMAP protocols.
See http://code.google.com/apis/gmail/oauth/

Resources