Open kanlanc opened 5 years ago
@highskillzz Thanks for posting! We'll take a look as soon as possible.
In the mean time, there are a few ways you can help speed things along:
Please remember: never post in a public forum if you believe you've found a genuine security vulnerability. Instead, disclose it responsibly.
For help with questions about Sails, click here.
Anyone?
You can optionally create a helper and integrate nodemailer
// am using gmail transports in this example
module.exports = {
friendlyName: "Send email",
description: "Sails helper to send emails",
inputs: {
to: {
type: "string",
required: true
},
subject: {
type: "string",
required: true
},
text: {
type: "string",
required: true
}
},
exits: {
success: {
description: "All done."
}
},
fn: async function(inputs) {
var nodemailer = require("nodemailer");
var transporter = nodemailer.createTransport({
service: "gmail",
auth: {
user: "example@gmail.com",
pass: "password"
}
});
var data = {
from: "demo <no-reply@demo.com>",
to: inputs.to,
subject: inputs.subject,
text: inputs.text
};
sails.log.debug(data);
transporter.sendMail(data, function(error, info) {
error
? sails.log.error(error)
: sails.log.info("Email sent: " + info.response);
});
}
};
or checkout https://github.com/mikermcneil/ration/blob/master/api/helpers/send-template-email.js
@highskillzz You appear to have sails-hook-organics installed which includes some basic mailgun stuff.
The "Web App" starter project should include some basic email functionality if you add your mailgun config. The Ration app also has a few examples of how to do it (using the sendTemplateEmail helper method to hide away some of the messiness of loading email templates).
https://github.com/mikermcneil/ration/blob/master/api/controllers/entrance/signup.js#L106 https://github.com/mikermcneil/ration/blob/master/api/controllers/deliver-contact-form-message.js#L63
Please answer this question I have, I have used zoho for making company emails and used my domain records over there. But, now I have to validate emails I get from users and mailgun seems to do that(from what I understand), but it is also asking domain details and to put records over there. Is there a way I can verify emails but not change zoho since it is providing company emails for free
@highskillzz Hi! I think that Mailgun gives you up to 12,000 emails per month free. The Sails web app template also provides send template email, which is designed to be maximally customizable.
See: helpers/send-template-email.js
I have used the template that comes when sails new is used, I originally thought that changing the config of verifyEmail would do what I need after adding the mailgun creds but this is not happening, this is my package.json
and I also don't see mailgun anywhere. How do I do this exactly?
Thank you