I'm creating Resources to send emails either via SMTP or via Retools new email resource.
I have two challenges:
I can insert HMTL into the body. But I'd like to abstract away the signature so that I only need to update in one place if needed. Modules would be ideal, but I need to add it to the App and cannot find a way to reference it inside the Resource query GUI builder. Any best approach for this?
On the email Resource builder GUI there is "from e-mail" but not "from" as name string, to specify the name of the sender. Is this possible?
If you don't use Resource Library you don't experient the advance it come with.
You should first create a query in Resource library, and set the query to retool email, and refer this query in app editor.
Just try it. There are some many awesome function to dig in.
I agree the Query Library is something I should explore as it allows to abstract away lots of cool stuff to be used in several apps.
But in this case I do not believe your proposal would solve my issues, because it would include the "sender" info on the e-mail body and not here:
As you can see the "name of the sender" is being parsed from the e-mail address, which is not ideal, because "team" means nothing to the receiver.
Regarding 1) I would need to insert the signature in the body of the "shared query", but as I create different e-mail templates (shared queries) I would need to update each one manually as the signature changes, right?
you can save them in global js variable( or use function to return it) in setting, and in different app's query use different signature. or you can encode these signatures and save it to database.
I notice this first time. I will research it and give your feedback
Continuing on this topic,
When setting up a SMTP mail we can have the "to" field to be a comma ", " separated list to send bulk emails(e.g. "asd@asd.com, gts@asd.com"). If one wants to insert in the body something like "Hi John", where john is retrieved from the database where a row has matching "email", how could one could achieve this?
I tried the following but got "undefined" where {{to_name}} is a query variable, to which I'm trying to pass the following from the App itself, where sendEmailSMTPTable is the imported resource query: