Using a variable to input send to email into Sendgrid dynamic send
Options
![Mr Kristian Hilton](https://us.v-cdn.net/6037124/user_avatars/2005940.jpg)
Mr Kristian Hilton
Member ✭
I am trying to use the sendgrid dynamic send function to send an email confirmation to a specific end user when they update a record.
I have set a get record function to return the only email of the user from the user database.
I then set the to email in the sendgrid function to use the outcome of the get record.
When I do a run and debug I get an error saying that the to email address in the sendgrid function is an incorrect format.
Does anybody know where I am going wrong?
I have set a get record function to return the only email of the user from the user database.
I then set the to email in the sendgrid function to use the outcome of the get record.
When I do a run and debug I get an error saying that the to email address in the sendgrid function is an incorrect format.
Does anybody know where I am going wrong?
Comments
-
Just wanted to reply real quick. Our support staff will check this out tomorrow during US business hours and give you an answer
Very glad to have you in the community! -
- it sounds like you might be inputting the entire response object of your Get Record to the email field.
You may have a variable like user:
{
"email": "example@email.com"
}
There is a key-value pair here. Because of this you still need to use dot notation or the GET filter to tell Xano what path within the variable's object to take to retrieve the value you want.
So you would need something like: user.email -
Thanks Michael that worked create. I having trouble with something else I hope you can help with.
Is there a way of sending an email to a group of users.
Using a To Do app as an example. When a new To Do has been added via the app, is there away from the backend to send an email to all users to let them know that a new to do has been added? -
Yes, so I would do this:
Query all records from user
For Each loop through user variable
Sendgrid email function... map email to item.email (where item is the iterated list from the loop)
You can either put all of that in a custom function and insert it to the same API endpoint after your new to do is added... or just build it all directly onto that same API endpoint.
Categories
- All Categories
- 53 ? Announcements
- 47 ? Releases
- 37 ? Welcome
- 983 ? Help! I'm a Noob
- 125 ? No-Code Front-Ends
- 633 ? Working with APIs
- 439 ? Transforming data
- 126 ? Connect Xano to ...
- 50 ?? Find an Expert
- 348 ❓Other questions
- 35 ? Security
- 22 ✂️ Snippets
- 19 ? Showcase
- 7 ?️ Xano Chatter
- 62 ? Video Tutorials
- 171 ? Request a feature
- 229 ? Report a Bug
- 19 ? Templates & Extensions
- 7 ? Feedback