-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mail connector undefined #1971
Comments
@DivCorleone, I've transferred your issue to |
Closing as duplicate of #1971. |
Sorry to close your issue by accident. Looks like this issue will be closed if I closed your original ticket. |
@DivCorleone, may I know what you're trying to accomplish in the code snippet above? |
I'm trying to send mails. I have seen your loopback v3 documentation, but unfortunately i didnt find a way to make it works in lb4 ? I tried reproducing every step in loopback v4 but for me some steps don't stick with lb4. Maybe i am not yet enough experienced with loopback to make it works. So here are the different approaches i tried: By following the v3 doc:
Having no answer to those questions i tried to do it my way by directly instantiating the MailDataSource, to make it connect, but his let mailer = new juggler.DataSource('mail', {
name: "mail",
connector: "mail",
"transports": [
{
"type": "smtp",
"host": "smtp.gmail.com",
"secure": true,
"port": 465,
"tls": {
"rejectUnauthorized": false
},
"auth": {
"user": "[email protected]",
"pass": "pass"
}
}
]
});
console.log('mailer.connector: ', mailer.connector); // undefined As you can see i'm a bit lost, am i missing something? I have a wrapper around nodemailer that can do the work, i'm just looking for a more LB4 friendly way of doing it. |
@DivCorleone, after discussing with @bajtos:
To go forward, what we'll need to do:
Hope it helps and thanks for reporting this. I'll create the tasks for the 2 to-dos. |
Thank you for the answers, that is good for me so i close the threat. |
@DivCorleone are you able to share a working sample of how you were able to get LB4 to work with nodemailer? I am unable to follow what you did from the brief description your mentioned above, unfortunately. |
Sorry but i never had a working example of nodemailer working inside of LB4. Idk if at this time LB4 mail connector has been implemented. The brief example was just to show that the mail connector was not present in LB4. |
@DivCorleone Oh that's a shame, it sounded like this was closed because you'd reached a viable workaround :( |
Yes, the workaround is to use nodemailer directly. Or use a community connector, but i didnt try this. |
I was able to add a controller to my LB4 application that sends email, by adding
Obviously the method would have to be fleshed out to be useful, and it would be preferable to have a proper LB4 email connector, but I hope this helps someone. |
do you have working model with LB4 which can trigger email? |
Sorry, I don't understand why you mean by working model... the sample above was in the controller and could use any model needed. |
please send me service part. |
Steps to reproduce
index.ts:
See Reporting Issues for more tips on writing good issues
The text was updated successfully, but these errors were encountered: