Send Email / SMTP Credentials: Choose by ID number (and expression)

The idea is:

Set the ID of which SMTP credentials to use in a Send Email node.
Add an expression to determine which ID it’s gonna be.

My use case:

A customer gives me smtp credentials. I create a new credential in N8N, save the credential’s ID. When I trigger a workflow for that customer, I want to choose his smtp credentials programmatically.

I think it would be beneficial to add this because:

I can create more general workflows, reusing them for different clients.
This way I have one workflow and can easily add new customers with minimal change to the workflow necessary.

Imagined difficulty

It should be quite easy to implement I believe, as we already have credential’s ids and can choose credentials in the Send Email node. The dropdown would only need to have expression support, accepting a valid credential ID filtering all the saved SMTP credentials.

If this is already possible, I couldn’t find it in the docs or community.
Any workaround ideas welcome!
(Would be great not to have to store in plain text or env files)

I also wanted to know if we can set googleOauth2API credential id and name via expression. It would be a great feature :slight_smile:

1 Like

Any Progress ?

Looks like at some point there will be some progress:

1 Like

Yup this is something that we have been talking about internally as it makes sense for anyone that wants to use n8n as a backend. Still not sure on timelines for this though.

1 Like