What does the query field in this function do?
I am guessing that I can pass an object into template values to be able to use these in the email template using {} around that value…?
And have I understood it right that I need to set up/use our own email server settings to get these templates to work?
Sorry for asking so much, but the documentation is a little on the short side…
The query
connector can contain a where clause that will be executed against the Users
table to identity the recipients. The query
and addresses
connectors are mutually exclusive. See the API doc for the API, the argument there is called criteria
: Send Emails with Templates API - Backendless REST API Documentation
Yes, you need to set up your own SMTP server for the functionality to work.
Regards,
Mark
Understood.
Yet more problems - it is that day
I have set up and saved SMTP record successfully. Backendless says Test is OK:
Also, sending test emails seem to work, both using templates and the standard registered email:
Yet, nothing is received. I can send using the same credentials using other tools but same SMTP, and email is received.
A couple of times I have received SMTP Logger messages like this:
0:33:27.760 | SMTP Logger | ERROR | Send message 'xxxxxx' was failed
I have tried sending 10+ times, and have 2 such records in the logs.
Is Backendless picky about this? Do I need to find another SMTP service to use? Any services that are known to work that I should opt for?
Backendless uses standard Java Mail API internally. The API has been tried and tested with numerous SMTP servers. I am not sure which one you’re using, but it seems like it is the mail server that is being picky about accepting a mail message. I see error messages in the logs saying “Invalid Addresses”
Ok… I’ll find another SMTP provider and do some SPF/DKIM work and see how it goes!
I’m taking this opportunity to ask a linked question : at present, email bounces or errors are signalled through SMTP logging and error email messages sent to the admin. I understand the “Send Email” method can’t throw an error immediately since messages are probably queued and sent asynchronously. However, would there be a way for the error to also trigger something else ? Like a handler or webhook of some sort ?
The use case I’m thinking about today :
- A user types in his email address, but makes a typo
- A confirmation email is sent to his (erroneous address)
- It bounces, but a bit later
- In the meantime the user has gone on to another screen
- He never receives his confirmation email
- He stops using the app because (in his mind) it hasn’t reliably sent the email
What I’m thinking about instead of the last step :
- Backendless perhaps writes something to the user record to mark that there was an issue sending the email
- Because the user record is flagged, the app displays a message stating that there was an issue messaging to the given email address
- The app can then provide a mechanism for the user to correct his typo
- We have just saved a (hard earned) user from abandoning his experience with the app
Just my 2 cents, in case it’s possible to flag such user records.
@Nicolas_REMY Not sure how you would map an email address with typo back to the right user, so for me the premise falls (even though it certainly would be nice).
Going back to my last post - I have now moved over to Amazon SES, which works perfectly fine!
I agree with @Egil_Helland, identifying the actual user based on some invalid email address would be near impossible, definitely with a very high margin of error.
Hi @mark-piller and @Egil_Helland ,
I realize while reading your two replies that I may not have been precise enough. In the first step of the scenario, please read instead :
- A user registers, with an email address in which he made a typo
Therefore, this erroneous email address is the one present in the user record. Therefore, there is no issue in associating the email bounce with a user in the Users table. This does not require any fuzzy logic or guessing. It’s there, exactly the same.