macarthuror / parse-smtp-template Goto Github PK
View Code? Open in Web Editor NEWParse Server Module to easy send emails via SMTP with a customizable template option
License: MIT License
Parse Server Module to easy send emails via SMTP with a customizable template option
License: MIT License
Even if you set extra parameters for every language the module continues to load default ones and not those of the right language.
I read the code and in fact only "others" parameters from "confirmOptions" and "passwordOptions" are loaded; for langOptions only "subject", "body" and "btn" parameters are loaded.
hello, I used "parse-smtp-template": "^2.2.0", it works well on "template: true",but failed on "multiTemplate: true"
here is my configure:
emailAdapter: {
module: 'parse-smtp-template',
options: {
secure: true,
port: 465,
host: "xxxxxx",
user: "xxxxxx",
password: "xxxxxx",
fromAddress: 'xxxxxxx',
//template: true,
//templatePath: "templates/main.html",
multiTemplate: true,
confirmTemplatePath: "templates/confirmTemplate.html",
//passwordTemplatePath: "templates/passwordTemplate.html",
passwordTemplatePath: "templates/main.html",
passwordOptions: {
subject: "Password reset",
body: "password recovery email",
btn: "Reset Password",
others: {
test:"test"
}
},
confirmOptions: {
subject: "verify email",
body: "email confirmation",
btn: "Confirm Email"
},
}
},
it report errors after request email:
{"level":"error","message":"Uncaught internal server error. username is not defined","stack":"ReferenceError: username is not defined\n at eval (eval at sendPasswordResetEmail (/root/www/node_modules/parse-smtp-template/index.js:292:24), :264:60)\n at Object.sendPasswordResetEmail (/root/www/node_modules/parse-smtp-template/index.js:292:24)\n at UserController.sendPasswordResetEmail (/root/www/node_modules/parse-server/lib/Controllers/UserController.js:295:20)\n at processTicksAndRejections (internal/process/task_queues.js:95:5)","timestamp":"2021-09-02T04:52:21.810Z"}
Setting port 465 for providers that require SSL authentication is not working.
Hello I am trying to use template with below specs :
emailAdapter: {
module: 'parse-smtp-template',
options: {
port: 465,
host: "mail.playm.io",
user: "[email protected]",
password: "***********",
fromAddress: '[email protected]'
}
}
But it gives this error
(node:4423) UnhandledPromiseRejectionWarning: Error: Greeting never received
at SMTPConnection._formatError (/Users/suatkarabacak/Desktop/playm/node_modules/parse-smtp-template/node_modules/nodemailer/lib/smtp-connection/index.js:784:19)
at SMTPConnection._onError (/Users/suatkarabacak/Desktop/playm/node_modules/parse-smtp-template/node_modules/nodemailer/lib/smtp-connection/index.js:770:20)
When email address is used as user name in Parse server, HTML template is filled with url-encoded email by ${username} parameter (ex. user%40mail.com)
I'm encountering a problem with this lib, whenever a user signs up with an email /domain that does not exist, the entire parse server just crashes, I'm guessing it's because it's trying to send to an unknown or invalid domain
Maybe a try catch would fix that, or maybe an exception needs to be made for OVH idk
Here is the error I get:
Error: queryA ETIMEOUT ssl0.ovh.net
at QueryReqWrap.onresolve [as oncomplete] (node:dns:213:19) {
errno: undefined,
code: 'EDNS',
syscall: 'queryA',
hostname: 'ssl0.ovh.net',
command: 'CONN'
}
m getting this issue when i try to send mails with port 465 through gmail and secure : true
[Error: 139953853953920:error:1408F10B:SSL routines:ssl3_get_record:wrong version number:../deps/openssl/openssl/ssl/record/ssl3_record.c:332:
0|Dwaya | ] {
0|Dwaya | library: 'SSL routines',
0|Dwaya | function: 'ssl3_get_record',
0|Dwaya | reason: 'wrong version number',
0|Dwaya | code: 'ESOCKET',
0|Dwaya | command: 'CONN'
0|Dwaya | }
Hello,
I am trying to add some extra parameters to my config file and template but it is not working out fine.
"multiLangConfirm": {
"en": {
"subject": "E-mail confirmation",
"body": "Mail confirmation email body",
"btn": "confirm your email",
"others": {
"footer": "Thank you!"
}
},
In the HTML template confirmTemplate.html I am adding ${others.footer}
Please let me know if this works or the correct way that it works with.
Thanks
When trying to use multi-language and multi templates, I get the following error
error: Uncaught internal server error. Cannot read properties of undefined (reading 'others') {"stack":"TypeError: Cannot read properties of undefined (reading 'others')\n at Object.sendPasswordResetEmail (C:\\Users\\megla\\AppData\\Roaming\\npm\\node_modules\\parse-smtp-template\\index.js:275:119)\n at UserController.sendPasswordResetEmail (C:\\Users\\megla\\AppData\\Roaming\\npm\\node_modules\\parse-server\\lib\\Controllers\\UserController.js:303:20)\n at processTicksAndRejections (node:internal/process/task_queues:96:5)"} TypeError: Cannot read properties of undefined (reading 'others') at Object.sendPasswordResetEmail (C:\Users\megla\AppData\Roaming\npm\node_modules\parse-smtp-template\index.js:275:119) at UserController.sendPasswordResetEmail (C:\Users\megla\AppData\Roaming\npm\node_modules\parse-server\lib\Controllers\UserController.js:303:20) at processTicksAndRejections (node:internal/process/task_queues:96:5)
did follow the same instructions in the ReadMe
I keep getting the same error with and without "others"
using signal template works without any issue.
I would also like to know something, how can you determine the language of the receiver? also, a feature request would be to create multiple files for each language since those are mostly static why not just pick a single file for each language instead.
Is there anyway to set the from name using this module? I mean, say I set the mail to be sent from '[email protected]'. Currently name shows as 'no-reply' (refer attached pic
). Any way to make this show as 'My Company'?
Started getting the following error:
Error: self-signed certificate
at TLSSocket.onConnectSecure (node:_tls_wrap:1535:34)
at TLSSocket.emit (node:events:513:28)
at TLSSocket.emit (node:domain:489:12)
at TLSSocket._finishInit (node:_tls_wrap:949:8)
at ssl.onhandshakedone (node:_tls_wrap:733:12)
Looks like this is due to gmail having self-signed certificates.
The following fix solves the issue:
tls: {
minVersion: 'TLSv1',
rejectUnauthorized: false // This is required since google self-signs their cert
}
However, it could be good for the module to have the tls settings configurable.
Hi,
Can I use other fields from the user class within the template? like firstname lastname and so on?
Sam
It will be great to add support for mailgun
When a user has the 'multiLangColumn' property set to a value that is not in the list (in multiLangPass for example), we get a 500 error.
Example:
For:
user.get('lang') = 'es'
multiLangPass: {
en: {
subject: "Password Reset",
body: "Somebody (hopefully you) requested a new password.",
btn: "Reset your password"
},
fr: {
subject: "Réinitialiser votre mot de passe",
body: "Quelqu'un a demandé un nouveau mot de passe pour votre compte.",
btn: "Réinitialiser votre mot de passe"
}
},
This throws a 500.
Hi i would like to implement multilanguage feature of parse-smtp-template.
I'v see usage in https://www.npmjs.com/package/parse-smtp-template#multi-language but i don't know how i can be sure that i'll work correctly according to the client-side application's language. How the package know that it must send a certain language rather than another. If you can show me a complete implementation it'll be awesome!!! Thanks!!!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.