Using various emails with Retool Email

Hello,
Would it be possible to send emails with personal email addresses and not the main email used to configure retool SMTP. So for example the email we used for SMTP is smtp.example.com and now we want all users with the example.com domain emails such ian@example.com to be able to send emails?

Thanks

Hi @Ian_Banda,

Welcome to the community!

Yes, it is possible to send emails with personal email addresses in Retool, even if the main email used to configure Retool SMTP is different. To do this, you can use a query to set the From field of the email to the user's personal email address.

For example, if you have a Retool app with a resource query called Send Email, you could set the From field to the following:

{{user.email}}

This will ensure that the email is sent from the user's personal email address, regardless of the main email used to configure Retool SMTP.

To restrict this to users with the example.com domain, you can use the following condition in your query:

{{user.email.endsWith('@example.com')}}

This will ensure that the email is only sent from users with the example.com domain.

Here is an example of a complete Retool resource query for sending emails with personal email addresses, restricted to users with the example.com domain:

{
  "resource": "Retool Email",
  "action": "send",
  "data": {
    "from": "{{user.email}}",
    "to": "{{email.value}}",
    "subject": "{{subject.value}}",
    "body": "{{body.value}}"
  },
  "conditions": [
    "{{user.email.endsWith('@example.com')}}"
  ]
}

Once you have created the query, you can use it in your Retool app to send emails from users' personal email addresses. For example, you could add a button to your app that calls the Send Email query when clicked.

I hope this helps!

:grinning:

Patrick

1 Like

Hey thanks for the quick response, however I did try what you've suggested and it doesn't seem to work. Is there something I am missing ?

Hey @Ian_Banda! When you say that this doesn't work what behavior are you seeing? Do you have restrictions on the SMTP side,I know some (ie SendGrid) will require that the email are verified before they can be used to send emails through the service.

Emails are sent from one central email that we used to configure the SMTP resource. Doesn’t matter what’s on the from field. I will check the restrictions on our end maybe that’s why it can’t work

1 Like