node-red / node-red/node-red-nodes

extending e-mail node's usage of nodemailer createTransport

Open
#123 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
1.1k
Forks
612
Avg merge
13h 57m
Merged PRs (30d)
3

Description

Hi.

The outgoing email node uses nodemailer to send email.
AFAIK, node-red doesn't let you change the options passed to nodemailer's createTransport method, which is crucial for use with some SMTP providers.

Some of the most well-known email providers require configuring the transport with more options other than just server and port, so it needs to be extendable in some way.

Would be more than happy to send a PR with a fix and tests, but wanted to ask about how you want to approach this.

Here's 2 cents:
Adding extra transport fields via the UI is probably not a good idea because it's too much of an edge-case, but maybe this is the sort of thing that should be extendable by passing in a msg with an extra property which contains an object that should be merged with the default configuration object.

It's not just a matter of enabling adding properties though, because right now the transport object is configured with secure: true by default, and this causes errors in some mail providers.
Removing this now would break existing flows, so if avoiding a breaking change is a priority, we could either
(a) Expose this as a checkbox in the UI which defaults to checked.
(b) Allow to override the default true by passing secure: false in the aforementioned new msg configuration property.

WDYT?

For reference:

Thanks!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with social/email/61-email.js at the createTransport call and review the linked Nodemailer configuration reference. The issue leaves the extension mechanism and secure default unresolved, so confirm the intended API and compatibility requirements first; done means an agreed transport-configuration behavior with tests covering it.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.